summaryrefslogtreecommitdiff
path: root/extra/thunar/fix-crash-8168.patch
blob: 4300c81c69de6182b450f7a87aeef47656e1e647 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 71f6f207cfd0194a3f3db83cb5fab694a5036e22 Mon Sep 17 00:00:00 2001
From: Jannis Pohlmann <jannis@xfce.org>
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