[gnome-photos/gnome-3-14] indexing-notification: Fix the lifetime of the miners-changed handler



commit fa08958e7dbb734bdbf256197ff8c87513cfb36b
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Feb 23 16:45:05 2015 +0100

    indexing-notification: Fix the lifetime of the miners-changed handler
    
    PhotosApplication outlives the notification widget because the window
    is destroyed before the application. Therefore we should disconnect
    from the miners-changed signal when the widget is destroyed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745070

 src/photos-indexing-notification.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-indexing-notification.c b/src/photos-indexing-notification.c
index b04f3db..ce9f46f 100644
--- a/src/photos-indexing-notification.c
+++ b/src/photos-indexing-notification.c
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2012, 2013, 2014 Red Hat, Inc.
+ * Copyright © 2012, 2013, 2014, 2015 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -301,10 +301,11 @@ photos_indexing_notification_init (PhotosIndexingNotification *self)
   gtk_container_add (GTK_CONTAINER (self), close);
   g_signal_connect_swapped (close, "clicked", G_CALLBACK (photos_indexing_notification_close_clicked), self);
 
-  g_signal_connect_swapped (app,
-                            "miners-changed",
-                            G_CALLBACK (photos_indexing_notification_check_notification),
-                            self);
+  g_signal_connect_object (app,
+                           "miners-changed",
+                           G_CALLBACK (photos_indexing_notification_check_notification),
+                           self,
+                           G_CONNECT_SWAPPED);
 
   g_signal_connect_swapped (priv->manager,
                             "miner-progress",


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