[gnome-photos/gnome-3-14] view-model: Fix the lifetime of the info-updated handler



commit a11aefdc6a483923f03b1872114c5b4b1908d3cf
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Feb 23 17:15:15 2015 +0100

    view-model: Fix the lifetime of the info-updated handler
    
    A BaseItem can outlive the model. The ItemManager controls the
    lifetime of the items, which is in turn bound to the lifetime of the
    application. The ViewModel is bound to the lifetime of the window,
    which is destroyed before the application.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745072

 src/photos-view-model.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-view-model.c b/src/photos-view-model.c
index e5ad665..bb4efc1 100644
--- a/src/photos-view-model.c
+++ b/src/photos-view-model.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
@@ -320,7 +320,7 @@ photos_view_model_object_added (PhotosViewModel *self, GObject *object)
   photos_view_model_add_item (self, item);
 
  out:
-  g_signal_connect (item, "info-updated", G_CALLBACK (photos_view_model_info_updated), self);
+  g_signal_connect_object (item, "info-updated", G_CALLBACK (photos_view_model_info_updated), self, 0);
 }
 
 


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