[gnome-photos] item-manager: Do not crash when a photo is deleted underneath
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] item-manager: Do not crash when a photo is deleted underneath
- Date: Fri, 7 Mar 2014 10:57:00 +0000 (UTC)
commit 0bbda089a758f51f41597ddb537c4bde7c875410
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]