Mercurial > pidgin
comparison libpurple/protocols/oscar/odc.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 | 648551e3243a |
comparison
equal
deleted
inserted
replaced
16390:4fc51a87ce42 | 16391:24bbd7e46bfe |
---|---|
351 embedded_data = g_hash_table_lookup(embedded_datas, | 351 embedded_data = g_hash_table_lookup(embedded_datas, |
352 GINT_TO_POINTER(id)); | 352 GINT_TO_POINTER(id)); |
353 | 353 |
354 if ((embedded_data != NULL) && (embedded_data->size == size)) | 354 if ((embedded_data != NULL) && (embedded_data->size == size)) |
355 { | 355 { |
356 imgid = purple_imgstore_add_with_id(embedded_data->data, size, src); | 356 imgid = purple_imgstore_add_with_id(g_memdup(embedded_data->data, size), size, src); |
357 | 357 |
358 /* Record the image number */ | 358 /* Record the image number */ |
359 images = g_slist_append(images, GINT_TO_POINTER(imgid)); | 359 images = g_slist_append(images, GINT_TO_POINTER(imgid)); |
360 } | 360 } |
361 } | 361 } |