[gnome-photos/wip/facebook] item-manager: The collection path might have NULL items
- From: Álvaro Peña <alvaropg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/facebook] item-manager: The collection path might have NULL items
- Date: Fri, 22 Nov 2013 22:04:44 +0000 (UTC)
commit cd540ba95e2e14af4008963a9fd74f48e3511c6a
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Oct 31 17:14:27 2013 +0100
item-manager: The collection path might have NULL items
This fixes a CRITICAL when clicking the back button to come out of an
album.
src/photos-item-manager.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 3755032..cda801c 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -126,6 +126,13 @@ photos_item_manager_changes_pending (PhotosTrackerChangeMonitor *monitor, GHashT
}
+static void
+photos_item_manager_collection_path_free_foreach (gpointer data, gpointer user_data)
+{
+ g_clear_object (&data);
+}
+
+
static gboolean
photos_item_manager_set_active_object (PhotosBaseManager *manager, GObject *object)
{
@@ -190,8 +197,12 @@ photos_item_manager_dispose (GObject *object)
PhotosItemManager *self = PHOTOS_ITEM_MANAGER (object);
PhotosItemManagerPrivate *priv = self->priv;
- g_queue_free_full (priv->collection_path, g_object_unref);
- priv->collection_path = NULL;
+ if (priv->collection_path != NULL)
+ {
+ g_queue_foreach (priv->collection_path, photos_item_manager_collection_path_free_foreach, NULL);
+ g_queue_free (priv->collection_path);
+ priv->collection_path = NULL;
+ }
g_clear_object (&priv->col_mngr);
g_clear_object (&priv->monitor);
@@ -243,7 +254,7 @@ photos_item_manager_activate_previous_collection (PhotosItemManager *self)
collection = G_OBJECT (g_queue_pop_head (priv->collection_path));
photos_base_manager_set_active_object (priv->col_mngr, collection);
- g_object_unref (collection);
+ g_clear_object (&collection);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]