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

Daniel P. Berrange berrange at redhat.com
Mon Jul 23 13:59:57 UTC 2012


On Tue, Jul 17, 2012 at 09:24:47PM +0200, Marc-André Lureau wrote:
> 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);

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list