# HG changeset patch # User Richard Laager # Date 1125644274 0 # Node ID 202a3b3c5a88919af4347171dbd88c595f146282 # Parent 31a17ec5a3074d4a5d25e4706ba803bd7445bfb1 [gaim-migrate @ 13660] Jason LeBrun asked for this on gaim-devel. gaim_buddy_icon_new() now leaves a reference for the caller. committer: Tailor Script diff -r 31a17ec5a307 -r 202a3b3c5a88 plugins/ChangeLog.API --- 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 diff -r 31a17ec5a307 -r 202a3b3c5a88 src/buddyicon.c --- 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); } }