[nautilus/wip/oholy/properties-window-critical-fix: 1/3] properties-window: Fix crashes when cancelled



commit 1464e6b5003500096480068c995d883686a9967a
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Sep 26 11:06:45 2019 +0200

    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.

 src/nautilus-properties-window.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 969e3ffea..a8b403924 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 */
@@ -5240,14 +5241,17 @@ properties_window_finish (StartupData *data)
                                               data);
     }
 
-    remove_pending (data, TRUE, (data->window == NULL), FALSE);
+    remove_pending (data, TRUE, (data->window == NULL && !data->cancelled), FALSE);
     startup_data_free (data);
 }
 
 static void
 cancel_create_properties_window_callback (gpointer callback_data)
 {
-    properties_window_finish ((StartupData *) callback_data);
+    StartupData *data = (StartupData *) callback_data;
+
+    data->cancelled = TRUE;
+    properties_window_finish (data);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]