comparison libpurple/protocols/silc/buddy.c @ 16391:24bbd7e46bfe

Change the imgstore and by extension, then the buddy icon code to take over the references to icon data instead of calling g_memdup(). This eliminates g_memdup()ing and g_free()ing in ~50% of the callers. For the rest, it's no worse (they now do a g_memdup() instead of the core) and they may be able to be modified in the future to avoid that.
author Richard Laager <rlaager@wiktel.com>
date Wed, 25 Apr 2007 22:23:29 +0000
parents 391a79778f89
children 5e47b3427b28
comparison
equal deleted inserted replaced
16390:4fc51a87ce42 16391:24bbd7e46bfe
985 !strcmp(type, "image/png")) { 985 !strcmp(type, "image/png")) {
986 const unsigned char *data; 986 const unsigned char *data;
987 SilcUInt32 data_len; 987 SilcUInt32 data_len;
988 data = silc_mime_get_data(m, &data_len); 988 data = silc_mime_get_data(m, &data_len);
989 if (data) 989 if (data)
990 purple_buddy_icons_set_for_user(purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), (void *)data, data_len); 990 purple_buddy_icons_set_for_user(purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), g_memdup(data, data_len), data_len);
991 } 991 }
992 silc_mime_free(m); 992 silc_mime_free(m);
993 } 993 }
994 } 994 }
995 #endif 995 #endif