From 71f6f207cfd0194a3f3db83cb5fab694a5036e22 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Sun, 26 Feb 2012 17:38:50 +0000 Subject: Fix crash when removing an ancestor of the current folder (bug #8168). Whenever we release the GFileMonitor of a ThunarFolder, we also need to disconnect from its signals. Otherwise one of the signal handlers might still be called, potentially with corrupted user data (which was the case here). --- diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c index 62015fe..4076b8d 100644 --- a/thunar/thunar-folder.c +++ b/thunar/thunar-folder.c @@ -236,6 +236,7 @@ thunar_folder_finalize (GObject *object) /* disconnect from the file alteration monitor */ if (G_LIKELY (folder->monitor != NULL)) { + g_signal_handlers_disconnect_matched (folder->monitor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, folder); g_file_monitor_cancel (folder->monitor); g_object_unref (folder->monitor); } @@ -705,6 +706,7 @@ thunar_folder_reload (ThunarFolder *folder) /* disconnect from the file alteration monitor */ if (G_UNLIKELY (folder->monitor != NULL)) { + g_signal_handlers_disconnect_matched (folder->monitor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, folder); g_file_monitor_cancel (folder->monitor); g_object_unref (folder->monitor); folder->monitor = NULL; -- cgit v0.9.0.2