[gthumb] folder tree: remove all the monitored location when finalizing



commit 899a22a80eabe4b74c55d0b1a4d7d0fc538837f5
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Dec 30 11:06:52 2012 +0100

    folder tree: remove all the monitored location when finalizing

 gthumb/gth-folder-tree.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-folder-tree.c b/gthumb/gth-folder-tree.c
index e953d4e..cf61c05 100644
--- a/gthumb/gth-folder-tree.c
+++ b/gthumb/gth-folder-tree.c
@@ -111,6 +111,9 @@ static guint gth_folder_tree_signals[LAST_SIGNAL] = { 0 };
 G_DEFINE_TYPE (GthFolderTree, gth_folder_tree, GTK_TYPE_TREE_VIEW)
 
 
+static void remove_all_locations_from_the_monitor (GthFolderTree *folder_tree);
+
+
 static void
 gth_folder_tree_finalize (GObject *object)
 {
@@ -124,6 +127,7 @@ gth_folder_tree_finalize (GObject *object)
 			folder_tree->priv->drag_target_list = NULL;
 		}
 		g_hash_table_unref (folder_tree->priv->entry_points);
+		remove_all_locations_from_the_monitor (folder_tree);
 		g_hash_table_unref (folder_tree->priv->monitor.locations);
 		_g_object_list_unref (folder_tree->priv->monitor.sources);
 		if (folder_tree->priv->root != NULL)
@@ -429,6 +433,20 @@ _gth_folder_tree_remove_from_monitor (GthFolderTree *folder_tree,
 
 
 static void
+remove_all_locations_from_the_monitor (GthFolderTree *folder_tree)
+{
+	GList *locations;
+	GList *scan;
+
+	locations = g_hash_table_get_keys (folder_tree->priv->monitor.locations);
+	for (scan = locations; scan; scan = scan->next)
+		_gth_folder_tree_remove_from_monitor (folder_tree, G_FILE (scan->data));
+
+	g_list_free (locations);
+}
+
+
+static void
 _gth_folder_tree_add_to_monitor (GthFolderTree *folder_tree,
 				 GFile         *file)
 {



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