[gnome-photos/wip/rishi/cancel-async: 1/6] collection-icon-watcher: Style fix



commit 86fb0e60ce4c1d4467ceff70e854ed4f552ecf6d
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 18 18:39:38 2016 +0100

    collection-icon-watcher: Style fix
    
    Always good to have a single return site when scope level clean ups
    are involved.

 src/photos-collection-icon-watcher.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-collection-icon-watcher.c b/src/photos-collection-icon-watcher.c
index 7ff8295..d3c5442 100644
--- a/src/photos-collection-icon-watcher.c
+++ b/src/photos-collection-icon-watcher.c
@@ -284,7 +284,7 @@ photos_collection_icon_watcher_query_executed (GObject *source_object, GAsyncRes
 {
   PhotosCollectionIconWatcher *self = PHOTOS_COLLECTION_ICON_WATCHER (user_data);
   TrackerSparqlConnection *connection = TRACKER_SPARQL_CONNECTION (source_object);
-  TrackerSparqlCursor *cursor;
+  TrackerSparqlCursor *cursor = NULL;
   GError *error;
 
   error = NULL;
@@ -293,14 +293,16 @@ photos_collection_icon_watcher_query_executed (GObject *source_object, GAsyncRes
     {
       g_warning ("Unable to query collection items: %s", error->message);
       g_error_free (error);
-      return;
+      goto out;
     }
 
   tracker_sparql_cursor_next_async (cursor,
                                     NULL,
                                     photos_collection_icon_watcher_cursor_next,
                                     g_object_ref (self));
-  g_object_unref (cursor);
+
+ out:
+  g_clear_object (&cursor);
 }
 
 


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