[gnome-photos/wip/rishi/cancel-async: 5/6] embed: Remove load_show_id during destruction



commit 2bb5a982b46ecedf1ac50656b85fea666f18495c
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 18 19:44:53 2016 +0100

    embed: Remove load_show_id during destruction
    
    It is better to cancel pending internal sources during destruction
    instead of delaying destruction by holding a reference to self.

 src/photos-embed.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index 9cb7c83..3b37a4c 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -351,11 +351,7 @@ static void
 photos_embed_load_started (PhotosEmbed *self, PhotosBaseItem *item)
 {
   photos_embed_clear_load_timer (self);
-  self->load_show_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
-                                           400,
-                                           photos_embed_load_show_timeout,
-                                           g_object_ref (self),
-                                           g_object_unref);
+  self->load_show_id = g_timeout_add (400, photos_embed_load_show_timeout, self);
 }
 
 
@@ -614,6 +610,7 @@ photos_embed_dispose (GObject *object)
 {
   PhotosEmbed *self = PHOTOS_EMBED (object);
 
+  photos_embed_clear_load_timer (self);
   photos_embed_clear_search (self);
 
   g_clear_object (&self->ntfctn_mngr);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]