im.pidgin.pidgin: 38789a886cd9ac8d6739a5a4171c2fc2be571497

sadrul at pidgin.im sadrul at pidgin.im
Wed Jan 23 00:10:52 EST 2008


-----------------------------------------------------------------
Revision: 38789a886cd9ac8d6739a5a4171c2fc2be571497
Ancestor: bfcb1dd917fc43d144e49244847dfc41b44ad335
Author: sadrul at pidgin.im
Date: 2008-01-23T05:16:39
Branch: im.pidgin.pidgin

Modified files:
        libpurple/buddyicon.c

ChangeLog: 

We need to store the img in the hashtable only after we have removed the old
one. Otherwise, we end up removing the new img. This fixes a crash when
setting the buddyicon from the account specific statusboxes.
Some of the prpls unref the img's (a41a12c3718fde3c2e793af5ad8f093942ba2802)
without having ref'ed them first. I think fixing that would be a better and
more correct solution.

-------------- next part --------------
============================================================
--- libpurple/buddyicon.c	1510361cd93e5a63a69c587840b39b2475c2e465
+++ libpurple/buddyicon.c	7e3021d171dbc56f69469993f4e696f2357424d4
@@ -701,11 +701,6 @@ purple_buddy_icons_set_account_icon(Purp
 	}
 	unref_filename(old_icon);
 
-	if (img)
-		g_hash_table_insert(pointer_icon_cache, account, img);
-	else
-		g_hash_table_remove(pointer_icon_cache, account);
-
 	if (purple_account_is_connected(account))
 	{
 		PurpleConnection *gc;
@@ -729,6 +724,11 @@ purple_buddy_icons_set_account_icon(Purp
 	}
 	g_free(old_icon);
 
+	if (img)
+		g_hash_table_insert(pointer_icon_cache, account, img);
+	else
+		g_hash_table_remove(pointer_icon_cache, account);
+
 	return img;
 }
 


More information about the Commits mailing list