[tracker/wip/carlosg/tracker-3.0-api-breaks: 89/95] libtracker-direct: Free tasks after g_task_return*



commit 060555668b1ae5cac12f07e638a644b0689b2fed
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Feb 4 23:35:49 2020 +0100

    libtracker-direct: Free tasks after g_task_return*
    
    It was missed in these paths.

 src/libtracker-direct/tracker-direct.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 4db502bf7..0155a1fcc 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -297,6 +297,8 @@ async_initable_thread_func (GTask        *task,
                g_task_return_error (task, error);
        else
                g_task_return_boolean (task, TRUE);
+
+       g_object_unref (task);
 }
 
 static void
@@ -643,8 +645,10 @@ tracker_direct_connection_query_async (TrackerSparqlConnection *self,
                              task_data_query_new (TASK_TYPE_QUERY, sparql),
                              (GDestroyNotify) task_data_free);
 
-       if (!g_thread_pool_push (priv->select_pool, task, &error))
+       if (!g_thread_pool_push (priv->select_pool, task, &error)) {
                g_task_return_error (task, error);
+               g_object_unref (task);
+       }
 }
 
 static TrackerSparqlCursor *


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