[gnome-photos/gnome-3-18] selection-toolbar: Fix the lifetime of the signal handlers



commit 5bab4d2f6d5ddfd10207b5227f24c7a15ff90a73
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Oct 26 13:03:21 2015 +0100

    selection-toolbar: Fix the lifetime of the signal handlers

 src/photos-selection-toolbar.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index 4082eed..f32118a 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -489,14 +489,16 @@ photos_selection_toolbar_init (PhotosSelectionToolbar *self)
   priv->item_mngr = g_object_ref (state->item_mngr);
 
   priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
-  g_signal_connect_swapped (priv->sel_cntrlr,
-                            "selection-changed",
-                            G_CALLBACK (photos_selection_toolbar_selection_changed),
-                            self);
-  g_signal_connect_swapped (priv->sel_cntrlr,
-                            "selection-mode-changed",
-                            G_CALLBACK (photos_selection_toolbar_selection_mode_changed),
-                            self);
+  g_signal_connect_object (priv->sel_cntrlr,
+                           "selection-changed",
+                           G_CALLBACK (photos_selection_toolbar_selection_changed),
+                           self,
+                           G_CONNECT_SWAPPED);
+  g_signal_connect_object (priv->sel_cntrlr,
+                           "selection-mode-changed",
+                           G_CALLBACK (photos_selection_toolbar_selection_mode_changed),
+                           self,
+                           G_CONNECT_SWAPPED);
 }
 
 


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