[gnome-settings-daemon] sharing: Fix launching services



commit 0caf67c7195a4de9d75a536e98fb9e0b3dbd6e02
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 25 11:39:03 2014 +0200

    sharing: Fix launching services
    
    If we managed to access the command-line, it was sheer luck.

 plugins/sharing/gsd-sharing-manager.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/sharing/gsd-sharing-manager.c b/plugins/sharing/gsd-sharing-manager.c
index 046a8a6..dc08b3c 100644
--- a/plugins/sharing/gsd-sharing-manager.c
+++ b/plugins/sharing/gsd-sharing-manager.c
@@ -120,11 +120,11 @@ gsd_sharing_manager_start_service (GsdSharingManager *manager,
         }
 
         exec = g_app_info_get_commandline (G_APP_INFO (app));
-        g_object_unref (app);
 
         if (!g_shell_parse_argv (exec, NULL, &argvp, &error)) {
                 g_warning ("Could not parse command-line '%s': %s", exec, error->message);
                 g_error_free (error);
+                g_object_unref (app);
                 return;
         }
 
@@ -139,6 +139,7 @@ gsd_sharing_manager_start_service (GsdSharingManager *manager,
         }
 
         g_strfreev (argvp);
+        g_object_unref (app);
 }
 
 static void


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