diff options
author | Ondrej Holy <oholy@redhat.com> | 2019-09-26 11:06:45 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2019-10-03 07:44:11 +0000 |
commit | b82d5b791edf7afe8db14f136c7ae6ef603d1303 (patch) | |
tree | a87f560b5f11f0d603d8dbc4540fd631150974d2 | |
parent | 6e1576e62cd344af3c9e0322111699a2ac78281f (diff) | |
download | nautilus-b82d5b791edf7afe8db14f136c7ae6ef603d1303.tar.gz |
properties-window: Fix crashes when cancelled
Nautilus crashes on the "timed_wait_free: assertion failed:
(g_hash_table_lookup (timed_wait_hash_table, wait) != NULL)" assertion
when the creating of the properties window is cancelled. This is because
the timed wait has been already removed. Let's don't remove the wait
when cancelled in order to prevent the crashes.
-rw-r--r-- | src/nautilus-properties-window.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index 969e3ffea..0112aeb3c 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -148,6 +148,7 @@ typedef struct NautilusPropertiesWindowCallback callback; gpointer callback_data; NautilusPropertiesWindow *window; + gboolean cancelled; } StartupData; /* drag and drop definitions */ @@ -5229,6 +5230,8 @@ get_existing_window (GList *file_list) static void properties_window_finish (StartupData *data) { + gboolean cancel_timed_wait; + if (data->parent_widget != NULL) { g_signal_handlers_disconnect_by_data (data->parent_widget, @@ -5240,14 +5243,21 @@ properties_window_finish (StartupData *data) data); } - remove_pending (data, TRUE, (data->window == NULL), FALSE); + cancel_timed_wait = (data->window == NULL && !data->cancelled); + remove_pending (data, TRUE, cancel_timed_wait, FALSE); + startup_data_free (data); } static void cancel_create_properties_window_callback (gpointer callback_data) { - properties_window_finish ((StartupData *) callback_data); + StartupData *data; + + data = callback_data; + data->cancelled = TRUE; + + properties_window_finish (data); } static void |