[glib: 1/2] gobject: Fix crash when disposing a GtkAccelGroup




commit 01ac1d902f160065078fb4e7abea840c2ef9ac28
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Jun 20 16:32:00 2022 +0100

    gobject: Fix crash when disposing a GtkAccelGroup
    
    This is a partial revert of commit fa8c7c0da using the approach
    suggested (and tested) by Kjell Ahlstedt.
    
    It is intended to be temporary pending a proper dig into what’s causing
    the regression, just so we can get the 2.73.1 release out.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #2672

 gobject/gobject.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index e43790ab99..df908984b7 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1360,7 +1360,10 @@ g_object_real_dispose (GObject *object)
   };
 
   g_signal_handlers_destroy (object);
-  g_datalist_id_remove_multiple (&object->qdata, keys, G_N_ELEMENTS (keys));
+  /* FIXME: This should be simplified down to a single remove_multiple() call.
+   * See https://gitlab.gnome.org/GNOME/glib/-/issues/2672 */
+  g_datalist_id_remove_multiple (&object->qdata, keys, 1);
+  g_datalist_id_remove_multiple (&object->qdata, keys + 1, 2);
 }
 
 #ifdef G_ENABLE_DEBUG


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