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

[virt-tools-list] [PATCH virt-viewer 2/4] Do not try to unref NULL menu



From: Marc-Andre Lureau <marcandre lureau redhat com>

---
 src/remote-viewer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 85ad319..d601ad3 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -320,7 +320,9 @@ spice_menu_update(RemoteViewer *self, VirtViewerWindow *win)
             ctrlmenu_to_gtkmenu(self, menu, G_OBJECT(self->priv->controller)));
         gtk_widget_set_visible(menuitem, TRUE);
     }
-    g_object_unref(menu);
+
+    if (menu != NULL)
+        g_object_unref(menu);
 }
 
 static void
-- 
1.7.7.6


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