diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-24 23:34:13 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-24 23:34:13 +0800 |
commit | 4b33293b29499f574955946aea70dae420e7accc (patch) | |
tree | 8335012be6983242f64033b6d911c75975eeea43 /libempathy-gtk/empathy-ui-utils.c | |
parent | fef8172419c5752d7d55e65cff3bd76a8176967e (diff) | |
download | gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.tar gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.tar.gz gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.tar.bz2 gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.tar.lz gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.tar.xz gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.tar.zst gsoc2013-empathy-4b33293b29499f574955946aea70dae420e7accc.zip |
properly manage the reference of the pixbuf returned by empathy_pixbuf_avatar_from_individual_scaled_finish
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index f33b6ebc0..5761308fa 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -604,7 +604,7 @@ avatar_file_load_contents_cb (GObject *object, } g_simple_async_result_set_op_res_gpointer (closure->result, - avatar_pixbuf_from_loader (loader), NULL); + avatar_pixbuf_from_loader (loader), g_object_unref); out: g_simple_async_result_complete (closure->result); @@ -654,6 +654,7 @@ out: g_object_unref (result); } +/* Return a ref on the GdkPixbuf */ GdkPixbuf * empathy_pixbuf_avatar_from_individual_scaled_finish ( FolksIndividual *individual, @@ -662,6 +663,7 @@ empathy_pixbuf_avatar_from_individual_scaled_finish ( { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); gboolean result_valid; + GdkPixbuf *pixbuf; g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL); g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple), NULL); @@ -674,7 +676,8 @@ empathy_pixbuf_avatar_from_individual_scaled_finish ( empathy_pixbuf_avatar_from_individual_scaled_async); g_return_val_if_fail (result_valid, NULL); - return g_simple_async_result_get_op_res_gpointer (simple); + pixbuf = g_simple_async_result_get_op_res_gpointer (simple); + return pixbuf != NULL ? g_object_ref (pixbuf) : NULL; } GdkPixbuf * |