[gnome-boxes] Destroy the main window at the end of App::quit()



commit 3acc7e4e8103eafa11397e139f0e8852d8e883b9
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Tue Sep 11 12:44:32 2012 +0200

    Destroy the main window at the end of App::quit()
    
    When exiting Boxes at the wizard summary screen, these warnings appear
    
    (gnome-boxes:2076): GLib-GObject-WARNING **: invalid uninstantiatable type
    `(null)' in cast to `GtkLabel'
    
    (gnome-boxes:2076): Gtk-CRITICAL **: gtk_label_set_markup: assertion
    `GTK_IS_LABEL (label)' failed
    
    (gnome-boxes:2635): Gtk-CRITICAL **: gtk_widget_hide: assertion
    `GTK_IS_WIDGET (widget)' failed
    
    (gnome-boxes:2635): GLib-GObject-WARNING **: invalid uninstantiatable type
    `(null)' in cast to `GtkLabel'
    
    (gnome-boxes:2635): Gtk-CRITICAL **: gtk_label_set_text: assertion
    `GTK_IS_LABEL (label)' failed
    
    (gnome-boxes:2635): Gtk-CRITICAL **: gtk_widget_show: assertion
    `GTK_IS_WIDGET (widget)' failed
    
    This occurs because on exit, App::quit() is called, which invokes
    in turn window.destroy (); and then wizard.cleanup ();
    
    window.destroy (); destroys some of the widgets used by Boxes, in
    particular the GdMainToolbars used in topbar.vala.
    
    wizard.cleanup (); will delete the machine that was being created.
    This will in particular trigger a call to
    Topbar::update_selection_label (); which will try to use the already
    destroyed GdMainToolbar, causing these warnings.
    
    This commit moves windows destruction until the end of App::quit ()
    so that Boxes UI stays alive until we have done the various cleanups
    we have to. A possibly better fix would be to have a BoxesAppWindow
    class deriving from GtkApplicationWindow which would make sure
    Boxes UI gets all cleaned up when it's destroyed, but this was a more
    invasive fix...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683792

 src/app.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 2a7a3e5..6054115 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -567,7 +567,7 @@ private class Boxes.App: Boxes.UI {
     public bool quit () {
         notificationbar.cancel ();
         save_window_geometry ();
-        window.destroy ();
+        window.hide ();
 
         foreach (var item in collection.items.data)
             if (item is LibvirtMachine) {
@@ -578,6 +578,7 @@ private class Boxes.App: Boxes.UI {
             }
 
         wizard.cleanup ();
+        window.destroy ();
 
         return false;
     }



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