[gtk+/popovers: 36/45] window: Remove popovers on dispose() before unsetting focus.



commit fe9cfbe1d911d6cd09f11c62412d8d52a838107f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 13 12:33:33 2014 +0100

    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 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 6f29079..2921fd2 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);
 }
 


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