[gnome-panel/wip/segeiger/fix-panel-run-dialog-critical-error: 2/2] panel-run-dialog.c: Avoid to unref null pointer



commit 7c9a4d054b90d35afc58636e4e0086929f77e66d
Author: Sebastian Geiger <sbastig gmx net>
Date:   Wed Jun 3 22:52:04 2015 +0200

    panel-run-dialog.c: Avoid to unref null pointer
    
     * If icon is NULL then glib will log a critical error on the console, we avoid this
       by adding a check before calling g_object_unref.

 gnome-panel/panel-run-dialog.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index bb7eacc..454b114 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -812,7 +812,9 @@ panel_run_dialog_find_command_idle (PanelRunDialog *dialog)
                }
 
                g_free (exec);
-               g_object_unref (icon);
+               if(icon) {
+                       g_object_unref (icon);
+               }
                g_free (name);
                g_free (comment);
        


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