|
|
0f37e7 |
From a20229f185b494a107634c4b99b2be1ce962a277 Mon Sep 17 00:00:00 2001
|
|
|
0f37e7 |
From: Ondrej Holy <oholy@redhat.com>
|
|
|
0f37e7 |
Date: Thu, 26 Sep 2019 11:06:45 +0200
|
|
|
0f37e7 |
Subject: [PATCH] properties-window: Fix crashes when cancelled
|
|
|
0f37e7 |
|
|
|
0f37e7 |
Nautilus crashes on the "timed_wait_free: assertion failed:
|
|
|
0f37e7 |
(g_hash_table_lookup (timed_wait_hash_table, wait) != NULL)" assertion
|
|
|
0f37e7 |
when the creating of the properties window is cancelled. This is because
|
|
|
0f37e7 |
the timed wait has been already removed. Let's don't remove the wait
|
|
|
0f37e7 |
when cancelled in order to prevent the crashes.
|
|
|
0f37e7 |
---
|
|
|
0f37e7 |
src/nautilus-properties-window.c | 14 ++++++++++++--
|
|
|
0f37e7 |
1 file changed, 12 insertions(+), 2 deletions(-)
|
|
|
0f37e7 |
|
|
|
0f37e7 |
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
|
|
|
0f37e7 |
index 969e3ffea..0112aeb3c 100644
|
|
|
0f37e7 |
--- a/src/nautilus-properties-window.c
|
|
|
0f37e7 |
+++ b/src/nautilus-properties-window.c
|
|
|
0f37e7 |
@@ -148,6 +148,7 @@ typedef struct
|
|
|
0f37e7 |
NautilusPropertiesWindowCallback callback;
|
|
|
0f37e7 |
gpointer callback_data;
|
|
|
0f37e7 |
NautilusPropertiesWindow *window;
|
|
|
0f37e7 |
+ gboolean cancelled;
|
|
|
0f37e7 |
} StartupData;
|
|
|
0f37e7 |
|
|
|
0f37e7 |
/* drag and drop definitions */
|
|
|
0f37e7 |
@@ -5229,6 +5230,8 @@ get_existing_window (GList *file_list)
|
|
|
0f37e7 |
static void
|
|
|
0f37e7 |
properties_window_finish (StartupData *data)
|
|
|
0f37e7 |
{
|
|
|
0f37e7 |
+ gboolean cancel_timed_wait;
|
|
|
0f37e7 |
+
|
|
|
0f37e7 |
if (data->parent_widget != NULL)
|
|
|
0f37e7 |
{
|
|
|
0f37e7 |
g_signal_handlers_disconnect_by_data (data->parent_widget,
|
|
|
0f37e7 |
@@ -5240,14 +5243,21 @@ properties_window_finish (StartupData *data)
|
|
|
0f37e7 |
data);
|
|
|
0f37e7 |
}
|
|
|
0f37e7 |
|
|
|
0f37e7 |
- remove_pending (data, TRUE, (data->window == NULL), FALSE);
|
|
|
0f37e7 |
+ cancel_timed_wait = (data->window == NULL && !data->cancelled);
|
|
|
0f37e7 |
+ remove_pending (data, TRUE, cancel_timed_wait, FALSE);
|
|
|
0f37e7 |
+
|
|
|
0f37e7 |
startup_data_free (data);
|
|
|
0f37e7 |
}
|
|
|
0f37e7 |
|
|
|
0f37e7 |
static void
|
|
|
0f37e7 |
cancel_create_properties_window_callback (gpointer callback_data)
|
|
|
0f37e7 |
{
|
|
|
0f37e7 |
- properties_window_finish ((StartupData *) callback_data);
|
|
|
0f37e7 |
+ StartupData *data;
|
|
|
0f37e7 |
+
|
|
|
0f37e7 |
+ data = callback_data;
|
|
|
0f37e7 |
+ data->cancelled = TRUE;
|
|
|
0f37e7 |
+
|
|
|
0f37e7 |
+ properties_window_finish (data);
|
|
|
0f37e7 |
}
|
|
|
0f37e7 |
|
|
|
0f37e7 |
static void
|
|
|
0f37e7 |
--
|
|
|
0f37e7 |
2.23.0
|
|
|
0f37e7 |
|