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.
This commit is contained in:
Carlos Garnacho 2014-01-13 12:33:33 +01:00
parent d105a3a36a
commit a3b3b4621c

View File

@ -2664,13 +2664,13 @@ gtk_window_dispose (GObject *object)
GtkWindow *window = GTK_WINDOW (object); GtkWindow *window = GTK_WINDOW (object);
GtkWindowPrivate *priv = window->priv; GtkWindowPrivate *priv = window->priv;
g_hash_table_remove_all (priv->popovers);
gtk_window_set_focus (window, NULL); gtk_window_set_focus (window, NULL);
gtk_window_set_default (window, NULL); gtk_window_set_default (window, NULL);
unset_titlebar (window); unset_titlebar (window);
remove_attach_widget (window); remove_attach_widget (window);
g_hash_table_remove_all (priv->popovers);
G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object); G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object);
} }