gobjectification: 2ab99dba: When initializing a PurpleConnection obj...
Elliott Sales de Andrade
qulogic at pidgin.im
Wed Aug 13 00:50:15 EDT 2008
On Tue, Aug 12, 2008 at 1:47 AM, Sadrul Habib Chowdhury
<imadil at gmail.com> wrote:
> * qulogic at pidgin.im had this to say on [12 Aug 2008, 00:56:46 -0400]:
>> Revision: 2ab99dba1f8047c40af1b87d397a5a90c78fe03f
>> When initializing a PurpleConnection object, save it in the connections
>> list so that PURPLE_CONNECTION_IS_VALID works properly. This fixes that
>> XMPP-login-freezes-stuff bug.
>> --- libpurple/connection.c 9db8a438a8038fc3d8f3033a7d0f454bafbda717
>> +++ libpurple/connection.c 0b8deb5cc06e2d1cbe281ff49936aeb880db8c54
>> @@ -810,6 +810,8 @@ purple_connection_init(GTypeInstance *in
>> PurpleConnection *pc = PURPLE_CONNECTION(instance);
>> pc->priv = g_new0(PurpleConnectionPrivate, 1);
>> + connections = g_list_append(connections, pc);
>> purple_connection_set_state(pc, PURPLE_CONNECTION_STATE_CONNECTING);
> If I recall correctly, this was left out specifically to make sure we
> can get rid of PURPLE_CONNECTION_IS_VALID. The check is usually used
> from some callbacks, and the idea is that all the callbacks associated
> with the PurpleObject should be disconnected/removed when the object is
> destroyed (thus making the _IS_VALID check unnecessary).
Ah, I see. Well, most of the XMPP callbacks seemed to be properly
removed anyway, so I dropped the PURPLE_CONNECTION_IS_VALID checks.
There were a couple other places which opened dialog windows. I worked
around those by taking another reference to the connection and
checking if it was connected in the callback. I'm not sure whether
they all work yet, though.
> On a side note, a *huge* thanks for working on i.p.g! :)
Somebody's gotta do it, or it'll be like MSNp14 ;)
More information about the Devel