[gnome-photos/gnome-3-12] item-manager: Do not crash when a photo is deleted underneath



commit 33c65de1b5acec9907fa9c71d038d571cc32a75c
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 7 10:34:17 2014 +0100

    item-manager: Do not crash when a photo is deleted underneath
    
    Removing an item from PhotosItemManager will destruct it, unless it is
    a collection. Do it at the end to avoid having an invalid pointer for
    the rest of the block.
    
    Fixes: https://bugzilla.gnome.org/725813

 src/photos-item-manager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index a2c9ef8..a3ca2a7 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -117,9 +117,9 @@ photos_item_manager_changes_pending_foreach (gpointer key, gpointer value, gpoin
       if (object != NULL)
         {
           photos_base_item_destroy (PHOTOS_BASE_ITEM (object));
-          photos_base_manager_remove_object_by_id (PHOTOS_BASE_MANAGER (self), change_urn);
           if (photos_base_item_is_collection (PHOTOS_BASE_ITEM (object)))
             photos_base_manager_remove_object_by_id (priv->col_mngr, change_urn);
+          photos_base_manager_remove_object_by_id (PHOTOS_BASE_MANAGER (self), change_urn);
         }
     }
 }


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