diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-08-19 01:13:02 +0800 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-08-19 01:55:09 +0800 |
commit | 015070caec0ec80ac53127c619bde516081670e6 (patch) | |
tree | fce9210305d5bd92578d85196671bdfb65cf93dc /libempathy-gtk/empathy-ui-utils.c | |
parent | 41c88d2a8b3670901473061dd53eb83e6f7ad34c (diff) | |
download | gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.tar gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.tar.gz gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.tar.bz2 gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.tar.lz gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.tar.xz gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.tar.zst gsoc2013-empathy-015070caec0ec80ac53127c619bde516081670e6.zip |
Allow cancellation of avatar load operations
Automatically cancel all pending avatar load operations when disposing of
an EmpathyIndividualStore. This prevents crashes when linking individuals in
the case that the EmpathyIndividualStore in the linking dialogue gets
notified of the new linked individual just before it's destroyed.
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 46a26d8f7..0a2d4f4f4 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -564,7 +564,7 @@ avatar_file_load_contents_cb (GObject *object, { GFile *file = G_FILE (object); PixbufAvatarFromIndividualClosure *closure = user_data; - char *data; + char *data = NULL; gsize data_size; struct SizeData size_data; GError *error = NULL; @@ -617,9 +617,10 @@ out: void empathy_pixbuf_avatar_from_individual_scaled_async ( FolksIndividual *individual, - GAsyncReadyCallback callback, gint width, gint height, + GCancellable *cancellable, + GAsyncReadyCallback callback, gpointer user_data) { GFile *avatar_file; @@ -639,7 +640,7 @@ empathy_pixbuf_avatar_from_individual_scaled_async ( if (closure == NULL) goto out; - g_file_load_contents_async (avatar_file, NULL, + g_file_load_contents_async (avatar_file, cancellable, avatar_file_load_contents_cb, closure); g_object_unref (result); |