[gnome-photos/gnome-3-16] application: Handle failures to create GomMiner proxies



commit 71ef1e9946aee4b388152253644f60efe00ac211
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Oct 8 17:02:24 2015 +0200

    application: Handle failures to create GomMiner proxies
    
    I came across a few intermittent failures to create the GomMiner
    proxies while running goa-daemon under valgrind. Let's atleast handle
    the failures and print the error message.

 src/photos-application.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 1ce318a..cd6c422 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -844,12 +844,19 @@ photos_application_startup (GApplication *application)
           GomMiner *miner;
           const gchar *extension_name;
 
+          error = NULL;
           miner = gom_miner_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
                                                     G_DBUS_PROXY_FLAGS_NONE,
                                                     base_item_class->miner_name,
                                                     base_item_class->miner_object_path,
                                                     NULL,
-                                                    NULL);
+                                                    &error);
+          if (error != NULL)
+            {
+              g_warning ("Unable to create GomMiner proxy for %s: %s", base_item_class->miner_name, 
error->message);
+              g_error_free (error);
+              continue;
+            }
 
           extension_name = g_io_extension_get_name (extension);
           g_object_set_data_full (G_OBJECT (miner), "provider-type", g_strdup (extension_name), g_free);


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