pidgin: d79cb151: Fixes this crash:

markdoliner at markdoliner at
Fri Feb 18 02:57:14 EST 2011

Revision: d79cb15140c8920bdfba4a1dbe9768c2022644c7
Parent:   8b5d777aea21ddc152e2892ab93fe51bb8483cde
Author:   markdoliner at
Date:     02/18/11 02:51:43
Branch:   im.pidgin.pidgin


Fixes this crash:
1. Open an IM window with someone who has just gone online or offline
2. Delete your account from the Accounts window
3. Wait for the 11 second timer to trigger

The conversation code was setting an 11 second timer when a buddy signs
online or offline so that it could stop showing the open door or close
door icon for the buddy, similar to what we do in the buddy list.  However,
we didn't keep track of the handle for this timer and didn't clear it if
the account is deleted--thus the crash.

I noticed that we don't currently show the open door or close door icons
in the conversation window.  I think it would be good if we did... but
I don't think the gtkconv code should keep track of this information.
gtkblist.c already keeps track of it in gtknode->recent_signonoff_timer.
We should either re-use that, or better yet, we should add "recent signon"
and "recent signoff" states to the status system somehow.

But I don't feel like working on that... it's pretty minor.  In any case
I don't think this code is the right way to handle it, so I'm getting
rid of it.  Feel free to disapprove this if you disagree! (But also please
fix the crash, maybe just by disabling the timer for now)

I'm also getting rid of the login_list and logout_list lists, since they're
not used.

1 file changed, 33 deletions(-)

Changes against parent 8b5d777aea21ddc152e2892ab93fe51bb8483cde

  patched  pidgin/gtkconv.c

-------------- next part --------------
--- pidgin/gtkconv.c	b23beb26e8c56bd23e4abe2b8dfd6d1b30c80971
+++ pidgin/gtkconv.c	23bd245ed474c65bc4873680fe48c2f2a47821f8
@@ -141,8 +141,6 @@ static GList *xa_list = NULL;
 static GList *away_list = NULL;
 static GList *busy_list = NULL;
 static GList *xa_list = NULL;
-static GList *login_list = NULL;
-static GList *logout_list = NULL;
 static GList *offline_list = NULL;
 static GHashTable *prpl_lists = NULL;
@@ -7567,33 +7565,11 @@ account_signing_off(PurpleConnection *gc
-struct _status_timeout_user {
-	gchar *name;
-	PurpleAccount *account;
-static gboolean
-update_buddy_status_timeout(struct _status_timeout_user *user)
-	/* To remove the signing-on/off door icon */
-	PurpleConversation *conv;
-	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, user->name, user->account);
-	if (conv)
-		pidgin_conv_update_fields(conv, PIDGIN_CONV_TAB_ICON);
-	g_free(user->name);
-	g_free(user);
-	return FALSE;
 static void
 update_buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus)
 	PidginConversation *gtkconv;
 	PurpleConversation *conv;
-	struct _status_timeout_user *user;
 	gtkconv = get_gtkconv_with_contact(purple_buddy_get_contact(buddy));
 	if (gtkconv)
@@ -7605,13 +7581,6 @@ update_buddy_status_changed(PurpleBuddy 
 		if ((purple_status_is_online(old) ^ purple_status_is_online(newstatus)) != 0)
 			pidgin_conv_update_fields(conv, PIDGIN_CONV_MENU);
-	user = g_malloc(sizeof(struct _status_timeout_user));
-	user->name = g_strdup(buddy->name);
-	user->account = buddy->account;
-	/* In case a conversation is started after the buddy has signed-on/off */
-	purple_timeout_add_seconds(11, (GSourceFunc)update_buddy_status_timeout, user);
 static void
@@ -9156,8 +9125,6 @@ create_icon_lists(GtkWidget *w)
 	available_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AVAILABLE, w);
 	busy_list = make_status_icon_list(PIDGIN_STOCK_STATUS_BUSY, w);
 	xa_list = make_status_icon_list(PIDGIN_STOCK_STATUS_XA, w);
-	login_list = make_status_icon_list(PIDGIN_STOCK_STATUS_LOGIN, w);
-	logout_list = make_status_icon_list(PIDGIN_STOCK_STATUS_LOGOUT, w);
 	offline_list = make_status_icon_list(PIDGIN_STOCK_STATUS_OFFLINE, w);
 	away_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AWAY, w);
 	prpl_lists = g_hash_table_new(g_str_hash, g_str_equal);

More information about the Commits mailing list