Mercurial > pidgin.yaz
diff libpurple/buddyicon.c @ 22185:bc2e96c13556
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.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 23 Jan 2008 05:16:39 +0000 |
parents | 47286f9bb434 |
children | edca47ee06c5 |
line wrap: on
line diff
--- a/libpurple/buddyicon.c Wed Jan 23 04:47:04 2008 +0000 +++ b/libpurple/buddyicon.c Wed Jan 23 05:16:39 2008 +0000 @@ -701,11 +701,6 @@ } 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 @@ } 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; }