[gnome-control-center/wip/jsparber/background: 26/28] background: fix crash of g-c-c by opening gnome-photos



commit cd3a71ce986c6bdb085338ccb33320db35d2ac71
Author: Julian Sparber <julian sparber net>
Date:   Tue Feb 6 21:48:34 2018 +0100

    background: fix crash of g-c-c by opening gnome-photos
    
    move g_object_unref (context) to the right line
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788515

 panels/background/cc-background-panel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 64ed4a64f..107abc4d5 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -399,18 +399,16 @@ on_open_gnome_photos (GtkWidget *widget,
   context = G_APP_LAUNCH_CONTEXT (gdk_display_get_app_launch_context (gdk_display_get_default ()));
   appInfo = g_desktop_app_info_new("org.gnome.Photos.desktop");
 
-  g_object_unref (context);
-
   if (appInfo == NULL) {
     g_debug ("Gnome Photos is not installed.");
   }
   else {
     g_app_info_launch (G_APP_INFO (appInfo), NULL, context, error);
-    g_prefix_error (error,
-                    ("Problem opening Gnome Photos: "));
+    g_prefix_error (error, "Problem opening Gnome Photos: ");
 
     g_object_unref (appInfo);
   }
+  g_object_unref (context);
 }
 
 static void


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