im.pidgin.pidgin: a41a12c3718fde3c2e793af5ad8f093942ba2802

khc at pidgin.im khc at pidgin.im
Mon Nov 19 02:50:39 EST 2007


-----------------------------------------------------------------
Revision: a41a12c3718fde3c2e793af5ad8f093942ba2802
Ancestor: 28981c935948f2d4e944f786a01e16ecadfd4848
Author: khc at pidgin.im
Date: 2007-11-19T07:44:51
Branch: im.pidgin.pidgin

Modified files:
        libpurple/buddyicon.c

ChangeLog: 

prpl->set_buddy_icon may keep a reference to PurpleStoredImage, move the
lookup to after the prpl callback because the prpl callback may unref the
previous image


-------------- next part --------------
============================================================
--- libpurple/buddyicon.c	84f321cc5c530656d8cd7c7ce38d722a27659341
+++ libpurple/buddyicon.c	5012ea05ae0c7f6c75ffcd988467cf4181ee728c
@@ -689,8 +689,6 @@ purple_buddy_icons_set_account_icon(Purp
 	PurpleStoredImage *img = NULL;
 	char *old_icon;
 
-	old_img = g_hash_table_lookup(pointer_icon_cache, account);
-
 	if (icon_data != NULL && icon_len > 0)
 	{
 		img = purple_buddy_icon_data_new(icon_data, icon_len, NULL);
@@ -728,7 +726,7 @@ purple_buddy_icons_set_account_icon(Purp
 			prpl_info->set_buddy_icon(gc, img);
 	}
 
-	if (old_img)
+	if ((old_img = g_hash_table_lookup(pointer_icon_cache, account)))
 		purple_imgstore_unref(old_img);
 	else if (old_icon)
 	{


More information about the Commits mailing list