[gtk/teardown-cleanup: 3/4] widget: work around teardown ordering issues
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/teardown-cleanup: 3/4] widget: work around teardown ordering issues
- Date: Mon, 11 May 2020 12:24:18 +0000 (UTC)
commit cc2f017007d31aef153afe2c251bd94816e9e3ac
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 10 17:02:17 2020 -0400
widget: work around teardown ordering issues
Many widgets do things on unmap; with us propagating
disposal more eagerly, we now end up in a situation where
widgets are already half-disposed when we reach the
widget dispose() implementation which unmaps, unroots
and unparents the widget. Work around this problem by
unmapping first thing in gtk_widget_destroy() - that
ensures that the widget is still intact when unmap()
is run.
This was causing crashes in several widgets such as
GtkStack, GtkFontChooserWidget or GtkScrolledWindow.
gtk/gtkwidget.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 2604a5856b..f3a399e817 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2631,6 +2631,8 @@ gtk_widget_destroy (GtkWidget *widget)
g_return_if_fail (GTK_IS_WIDGET (widget));
+ gtk_widget_unmap (widget);
+
if (!priv->in_destruction)
g_object_run_dispose (G_OBJECT (widget));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]