[grilo/wip/hadess/test-ui-startup-crash] grilo-test-ui: Fix crash if app couldn't get on the bus




commit c13f87e74b90c23f683df526746775362f95d4cf
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Aug 26 12:38:57 2020 +0200

    grilo-test-ui: Fix crash if app couldn't get on the bus
    
    If the application couldn't own a name on the session bus, then it would
    never setup its UI, and view would be a NULL pointer which we'd
    dereference, and crash.
    
    Exit early from cleanup function if the view was never setup.

 tools/grilo-test-ui/main.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c
index 17e5389..01aa22a 100644
--- a/tools/grilo-test-ui/main.c
+++ b/tools/grilo-test-ui/main.c
@@ -512,6 +512,9 @@ set_cur_resolve (GrlSource *source, GrlMedia *media)
 static void
 clear_panes (void)
 {
+  if (!view)
+    return;
+
   /* Prevent undesired cursor-changed signal calls */
   gtk_tree_view_set_model (GTK_TREE_VIEW (view->browser),
                            NULL);


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