[gnome-photos/gnome-3-16] view-model: Fix the lifetime of the signal handlers



commit fdb6a163ba5c3e11b51a846b381f9aeafb28ea79
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 12 16:53:40 2015 +0100

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

 src/photos-view-model.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-view-model.c b/src/photos-view-model.c
index 735276d..7eaeabc 100644
--- a/src/photos-view-model.c
+++ b/src/photos-view-model.c
@@ -369,13 +369,22 @@ photos_view_model_constructed (GObject *object)
       break;
     }
 
-  g_signal_connect_swapped (priv->item_mngr, "object-added", G_CALLBACK (photos_view_model_object_added), 
self);
-  g_signal_connect_swapped (priv->item_mngr, "object-removed", G_CALLBACK 
(photos_view_model_object_removed), self);
-
-  g_signal_connect_swapped (priv->trk_cntrlr,
-                            "query-status-changed",
-                            G_CALLBACK (photos_view_model_query_status_changed),
-                            self);
+  g_signal_connect_object (priv->item_mngr,
+                           "object-added",
+                           G_CALLBACK (photos_view_model_object_added),
+                           self,
+                           G_CONNECT_SWAPPED);
+  g_signal_connect_object (priv->item_mngr,
+                           "object-removed",
+                           G_CALLBACK (photos_view_model_object_removed),
+                           self,
+                           G_CONNECT_SWAPPED);
+
+  g_signal_connect_object (priv->trk_cntrlr,
+                           "query-status-changed",
+                           G_CALLBACK (photos_view_model_query_status_changed),
+                           self,
+                           G_CONNECT_SWAPPED);
 }
 
 


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