[gnome-photos] base-manager: Emit object-removed after the object has been removed



commit b1dfea91e9b770b6022e3ade98f2e0c02d3b133f
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Dec 11 00:15:02 2013 +0100

    base-manager: Emit object-removed after the object has been removed

 src/photos-base-manager.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-base-manager.c b/src/photos-base-manager.c
index fd6fd49..0c20f97 100644
--- a/src/photos-base-manager.c
+++ b/src/photos-base-manager.c
@@ -307,8 +307,10 @@ photos_base_manager_process_new_objects (PhotosBaseManager *self, GHashTable *ne
       g_object_get (object, "builtin", &builtin, NULL);
       if (g_hash_table_lookup (new_objects, id) == NULL && !builtin)
         {
-          g_signal_emit (self, signals[OBJECT_REMOVED], 0, object);
+          g_object_ref (object);
           g_hash_table_iter_remove (&iter);
+          g_signal_emit (self, signals[OBJECT_REMOVED], 0, object);
+          g_object_unref (object);
         }
     }
 
@@ -346,8 +348,10 @@ photos_base_manager_remove_object_by_id (PhotosBaseManager *self, const gchar *i
   if (object == NULL)
     return;
 
-  g_signal_emit (self, signals[OBJECT_REMOVED], 0, object);
+  g_object_ref (object);
   g_hash_table_remove (self->priv->objects, id);
+  g_signal_emit (self, signals[OBJECT_REMOVED], 0, object);
+  g_object_unref (object);
 }
 
 


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