diff options
author | Federico Mena Quintero <federico@gnome.org> | 2011-09-30 09:43:59 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2012-09-03 20:52:40 -0500 |
commit | b8b6d592e675e33689757d91c983f1f10a387de4 (patch) | |
tree | f406751e63e1145e85c3399d579da1f43ed2d08f /gtk/gtkbookmarksmanager.c | |
parent | 36969380b3ba7a2ca322b53022c3b869e5470043 (diff) | |
download | gtk+-b8b6d592e675e33689757d91c983f1f10a387de4.tar.gz |
Cancel and disconnect from the bookmarks monitor when done
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Diffstat (limited to 'gtk/gtkbookmarksmanager.c')
-rw-r--r-- | gtk/gtkbookmarksmanager.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkbookmarksmanager.c b/gtk/gtkbookmarksmanager.c index 19f79f9eb0..2bb16b79ef 100644 --- a/gtk/gtkbookmarksmanager.c +++ b/gtk/gtkbookmarksmanager.c @@ -224,8 +224,8 @@ _gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func, gpointer chang g_error_free (error); } else - g_signal_connect (manager->bookmarks_monitor, "changed", - G_CALLBACK (bookmarks_file_changed), manager); + manager->bookmarks_monitor_changed_id = g_signal_connect (manager->bookmarks_monitor, "changed", + G_CALLBACK (bookmarks_file_changed), manager); g_object_unref (bookmarks_file); @@ -238,7 +238,12 @@ _gtk_bookmarks_manager_free (GtkBookmarksManager *manager) g_return_if_fail (manager != NULL); if (manager->bookmarks_monitor) - g_object_unref (manager->bookmarks_monitor); + { + g_file_monitor_cancel (manager->bookmarks_monitor); + g_signal_handler_disconnect (manager->bookmarks_monitor, manager->bookmarks_monitor_changed_id); + manager->bookmarks_monitor_changed_id = 0; + g_object_unref (manager->bookmarks_monitor); + } if (manager->bookmarks) { |