After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683792 - Fix criticals when exiting boxes on wizard summary screen
Fix criticals when exiting boxes on wizard summary screen
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-09-11 11:18 UTC by Christophe Fergeau
Modified: 2016-03-31 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make Machine::get_screenshot_filename private (773 bytes, patch)
2012-09-11 11:18 UTC, Christophe Fergeau
committed Details | Review
Report errors in Machine::get_screenshot_filename() (1.83 KB, patch)
2012-09-11 11:18 UTC, Christophe Fergeau
committed Details | Review
Destroy the main window at the end of App::quit() (2.37 KB, patch)
2012-09-11 11:19 UTC, Christophe Fergeau
committed Details | Review

Description Christophe Fergeau 2012-09-11 11:18:52 UTC
If you quit boxes while it's at the wizard summary screen, some criticals
appear in the console, these patches fixes those.
Comment 1 Christophe Fergeau 2012-09-11 11:18:54 UTC
Created attachment 224012 [details] [review]
Make Machine::get_screenshot_filename private

It's only used in machine.vala
Comment 2 Christophe Fergeau 2012-09-11 11:18:57 UTC
Created attachment 224013 [details] [review]
Report errors in Machine::get_screenshot_filename()

When the VM has just been created, config.uuid is not known yet.
When we quit Boxes from the wizard summary screen, the VM is deleted
when it's in such a state, which causes Criticals on the console when
it tries to delete the VM screenshot:

(gnome-boxes:5027): Boxes-CRITICAL **: boxes_get_screenshot_filename:
assertion `prefix != NULL' failed

This commit changes get_screenshot_filename() to report errors by
throwing a Boxes.Error exception and catches it in callers. This
removes the get_screenshot_filename() criticals in the scenario
described above.
Comment 3 Christophe Fergeau 2012-09-11 11:19:00 UTC
Created attachment 224014 [details] [review]
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...
Comment 4 Alexander Larsson 2012-09-12 12:17:34 UTC
Review of attachment 224013 [details] [review]:

ack
Comment 5 Alexander Larsson 2012-09-12 12:18:02 UTC
Review of attachment 224014 [details] [review]:

ack
Comment 6 Alexander Larsson 2012-09-12 12:18:39 UTC
Review of attachment 224012 [details] [review]:

ack
Comment 7 Christophe Fergeau 2012-09-13 16:13:48 UTC
Attachment 224012 [details] pushed as 571fcd1 - Make Machine::get_screenshot_filename private
Attachment 224013 [details] pushed as b04e43f - Report errors in Machine::get_screenshot_filename()
Attachment 224014 [details] pushed as 3acc7e4 - Destroy the main window at the end of App::quit()