[gnome-photos] base-model: Fix the lifetime of the signal handlers



commit 9da59e20c10d0c78b433cd7e5bae2d38081307f0
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 12 16:50:13 2015 +0100

    base-model: Fix the lifetime of the signal handlers
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746104

 src/photos-base-model.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-base-model.c b/src/photos-base-model.c
index 80326ac..a731f6e 100644
--- a/src/photos-base-model.c
+++ b/src/photos-base-model.c
@@ -99,8 +99,16 @@ photos_base_model_constructed (GObject *object)
 
   G_OBJECT_CLASS (photos_base_model_parent_class)->constructed (object);
 
-  g_signal_connect_swapped (priv->mngr, "object-added", G_CALLBACK (photos_base_model_refresh), self);
-  g_signal_connect_swapped (priv->mngr, "object-removed", G_CALLBACK (photos_base_model_refresh), self);
+  g_signal_connect_object (priv->mngr,
+                           "object-added",
+                           G_CALLBACK (photos_base_model_refresh),
+                           self,
+                           G_CONNECT_SWAPPED);
+  g_signal_connect_object (priv->mngr,
+                           "object-removed",
+                           G_CALLBACK (photos_base_model_refresh),
+                           self,
+                           G_CONNECT_SWAPPED);
 
   photos_base_model_refresh (self);
 }


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