[gaim-migrate @ 13660]

Fri, 02 Sep 2005 06:57:54 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Fri, 02 Sep 2005 06:57:54 +0000
changeset 11423
45f4ca09d1d6
parent 11422
58430d1204e6
child 11424
b0f8535daa74

[gaim-migrate @ 13660]
Jason LeBrun asked for this on gaim-devel. gaim_buddy_icon_new() now leaves a reference for the caller.

plugins/ChangeLog.API file | annotate | diff | comparison | revisions
src/buddyicon.c file | annotate | diff | comparison | revisions
--- a/plugins/ChangeLog.API	Fri Sep 02 05:46:28 2005 +0000
+++ b/plugins/ChangeLog.API	Fri Sep 02 06:57:54 2005 +0000
@@ -78,6 +78,9 @@
 	* Changed: gaim_log_new(), added conv parameter
 	* Added:   gaim_buddy_icons_get_full_path(), to get the full path
 	           of a buddy icon setting
+	* Changed: gaim_buddy_icon_new(), leaves a reference which the caller
+	           owns. Use gaim_buddy_icon_unref() immediately if you don't
+	           want a reference (the old behavior).
 
 	Signals:
 	* Changed: "received-im-msg" and "received-chat-msg" to match, both
--- a/src/buddyicon.c	Fri Sep 02 05:46:28 2005 +0000
+++ b/src/buddyicon.c	Fri Sep 02 06:57:54 2005 +0000
@@ -75,11 +75,13 @@
 
 	gaim_buddy_icon_ref(icon);
 	gaim_buddy_icon_set_data(icon, icon_data, icon_len);
-	gaim_buddy_icon_unref(icon);
 
-	/* We don't take a reference here. gaim_buddy_icon_set_data() makes blist.c or
-	   conversation.c, or both, do that for us.
+	/* gaim_buddy_icon_set_data() makes blist.c or
+	 * conversation.c, or both, take a reference.
+	 *
+	 * Plus, we leave one for the caller of this function.
 	 */
+
 	return icon;
 }
 
@@ -412,7 +414,8 @@
 	}
 	else
 	{
-		gaim_buddy_icon_new(account, username, icon_data, icon_len);
+		GaimBuddyIcon *icon = gaim_buddy_icon_new(account, username, icon_data, icon_len);
+		gaim_buddy_icon_unref(icon);
 	}
 }
 

mercurial