From a3b3b4621c716097212f774eaf3202c1948bd5bf Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 13 Jan 2014 12:33:33 +0100 Subject: [PATCH] window: Remove popovers on dispose() before unsetting focus. The popovers may return keyboard grabs to previous widgets, so if called after unsetting the focus, the window may be left with a dangling GtkWidget that would cause crash at later dispose() calls. --- gtk/gtkwindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 84792c7da0..d4f6e9810c 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -2664,13 +2664,13 @@ gtk_window_dispose (GObject *object) GtkWindow *window = GTK_WINDOW (object); GtkWindowPrivate *priv = window->priv; + g_hash_table_remove_all (priv->popovers); + gtk_window_set_focus (window, NULL); gtk_window_set_default (window, NULL); unset_titlebar (window); remove_attach_widget (window); - g_hash_table_remove_all (priv->popovers); - G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object); }