comparison libpurple/buddyicon.c @ 16620:36981d83b20c

Fix a crash when removing a per-account icon. Here's my explanation: 21:45:22 rlaager: Since we're not saving the buddy icon path to disk (which, as I mentioned earlier, only exists because of QQ), we end up with that being NULL, which is fine. 21:46:08 rlaager: Where fine = fine, as long as we don't care about QQ and if we do, my changes didn't change that behavior, so it's no worse. ;) 21:46:33 rlaager: The crash in the buddy icon code happens because filename is NULL. In that case, we can return, because the image_deleting_cb is only concerned with those PurpleStoredImages that were created by the buddy icon code. I'll commit the fix.
author Richard Laager <rlaager@wiktel.com>
date Sun, 29 Apr 2007 02:49:23 +0000
parents 8d8168fada21
children 898019538f44
comparison
equal deleted inserted replaced
16614:8d8168fada21 16620:36981d83b20c
210 static void 210 static void
211 image_deleting_cb(PurpleStoredImage *img, gpointer data) 211 image_deleting_cb(PurpleStoredImage *img, gpointer data)
212 { 212 {
213 const char *filename = purple_imgstore_get_filename(img); 213 const char *filename = purple_imgstore_get_filename(img);
214 214
215 /* If there's no filename, it can't be one of our images. */
216 if (filename == NULL)
217 return;
218
215 if (img == g_hash_table_lookup(icon_data_cache, filename)) 219 if (img == g_hash_table_lookup(icon_data_cache, filename))
216 { 220 {
217 purple_buddy_icon_data_uncache_file(filename); 221 purple_buddy_icon_data_uncache_file(filename);
218 g_hash_table_remove(icon_data_cache, filename); 222 g_hash_table_remove(icon_data_cache, filename);
219 223