[virt-tools-list] [PATCH virt-viewer 05/25] Destroy dialog immediately after run

Marc-André Lureau marcandre.lureau at gmail.com
Tue Jul 17 19:24:47 UTC 2012


If the parent is already destroyed, it looks like the dialog is
destroyed too. This avoids a crash when calling app_quit().
---
 src/virt-viewer-app.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 40d1ff7..1447ce7 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -283,6 +283,7 @@ virt_viewer_app_window_set_visible(VirtViewerApp *self,
                                         GTK_BUTTONS_OK_CANCEL,
                                         _("This is the last visible display. Do you want to quit?"));
             gint result = gtk_dialog_run (GTK_DIALOG (dialog));
+            gtk_widget_destroy(dialog);
             switch (result) {
             case GTK_RESPONSE_OK:
                 virt_viewer_app_quit(self);
@@ -290,7 +291,6 @@ virt_viewer_app_window_set_visible(VirtViewerApp *self,
             default:
                 break;
             }
-            gtk_widget_destroy(dialog);
             return FALSE;
         } else {
             virt_viewer_app_quit(self);
-- 
1.7.10.4




More information about the virt-tools-list mailing list