[gnome-photos] tracker-queue: Use g_auto*
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] tracker-queue: Use g_auto*
- Date: Fri, 6 Apr 2018 18:13:33 +0000 (UTC)
commit 6086bb89baf39ab6316bcfb80083c0dc76a203d5
Author: Umang Jain <mailumangjain gmail com>
Date: Thu Mar 1 16:34:16 2018 +0700
tracker-queue: Use g_auto*
https://gitlab.gnome.org/GNOME/gnome-photos/issues/77
src/photos-tracker-queue.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-tracker-queue.c b/src/photos-tracker-queue.c
index 0d0cc810..76683ff3 100644
--- a/src/photos-tracker-queue.c
+++ b/src/photos-tracker-queue.c
@@ -88,6 +88,9 @@ photos_tracker_queue_data_free (PhotosTrackerQueueData *data)
}
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotosTrackerQueueData, photos_tracker_queue_data_free);
+
+
static PhotosTrackerQueueData *
photos_tracker_queue_data_new (PhotosQuery *query,
PhotosTrackerQueryType query_type,
@@ -141,8 +144,8 @@ photos_tracker_queue_log_query (PhotosQuery *query)
static void
photos_tracker_queue_collector (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
- PhotosTrackerQueue *self = PHOTOS_TRACKER_QUEUE (user_data);
- PhotosTrackerQueueData *data;
+ g_autoptr (PhotosTrackerQueue) self = PHOTOS_TRACKER_QUEUE (user_data);
+ g_autoptr (PhotosTrackerQueueData) data = NULL;
photos_debug (PHOTOS_DEBUG_TRACKER, "Query processed");
@@ -150,10 +153,8 @@ photos_tracker_queue_collector (GObject *source_object, GAsyncResult *res, gpoin
if (data->callback != NULL)
(*data->callback) (source_object, res, data->user_data);
self->running = FALSE;
- photos_tracker_queue_data_free (data);
photos_tracker_queue_check (self);
- g_object_unref (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]