Libpurple disconnecting issue
Evan Schoenberg
evands at pidgin.im
Wed Mar 26 15:31:04 EDT 2008
On Mar 26, 2008, at 11:45 AM, Benjamin Arnaud wrote:
> I'm developping a threaded Qt windows client. I have a full thread
> to run Libpurple in its own GLIB loop environment.
>
>
> It's running on windows I have this line in my event input add:
> #ifdef _WIN32
>
> channel = wpurple_g_io_channel_win32_new_socket(fd);
>
>
> Unfortunately it appears that when calling
> "purple_account_disconnect" I get random crashes :
>
> the only output I have is :
>
> (client.exe:352): GLib-CRITICAL ** : g_hash_table_destroy: assertion
> `hash_table->ref_count > 0' failed.
>
> (I get this line FOUR times).
>
> When calling "g_io_channel_unix_new" instead of
> "wpurple_g_io_channel_win32_new_socket" the error disappears.
>
>
> Has anyone encountered the same thing ? Can it be an issue with
> threading ? Could I contribute to solve this ?
>
libpurple should be able to run on a thread, but it is vital that you
ensure that *all* messages to libpurple are sent on that thread, as
libpurple is not safe for interthread interactions. Are you managing
the glib run loop such that it iterates on your libpurple thread?
Are you sure you really need to run libpurple and glib on a thread in
any case? A lot of effort has gone into ensuring that libpurple acts
in a non-blocking fashion for networking operations and most time-
consuming calls.
-Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20080326/3982b04b/attachment.html>
More information about the Devel
mailing list