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



commit 3856a02676840ee0740454025452b8e2bbfcb047
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Oct 26 11:58:49 2015 +0100

    selection-toolbar: Fix the lifetime of the signal handlers
    
    The items can potentially outlive the toolbar.

 src/photos-selection-toolbar.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index a77ab2a..6cb4781 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -327,10 +327,11 @@ photos_selection_toolbar_set_item_listeners (PhotosSelectionToolbar *self, GList
       gulong id;
 
       object = photos_base_manager_get_object_by_id (priv->item_mngr, urn);
-      id = g_signal_connect_swapped (object,
-                                     "info-updated",
-                                     G_CALLBACK (photos_selection_toolbar_set_item_visibility),
-                                     self);
+      id = g_signal_connect_object (object,
+                                    "info-updated",
+                                    G_CALLBACK (photos_selection_toolbar_set_item_visibility),
+                                    self,
+                                    G_CONNECT_SWAPPED);
       g_hash_table_insert (priv->item_listeners, GUINT_TO_POINTER (id), g_object_ref (object));
     }
 }


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