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



commit 2686b006da7bacbc78c37783d719d35081130c54
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.

 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]