[tracker-miners/wip/carlosg/fix-leaks: 5/5] libtracker-miner: Fix refcounting of TrackerMonitor thread requests
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/fix-leaks: 5/5] libtracker-miner: Fix refcounting of TrackerMonitor thread requests
- Date: Sun, 5 Dec 2021 18:25:38 +0000 (UTC)
commit 5b3909525d9d011b1999f04a3379222101797691
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Dec 5 17:58:31 2021 +0100
libtracker-miner: Fix refcounting of TrackerMonitor thread requests
The files were leaked in some places, and compensated by a missing ref()
in some places.
src/libtracker-miner/tracker-monitor.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index 81d17003c..47289afcf 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -590,6 +590,7 @@ monitor_request_execute (MonitorRequest *request)
}
request->files = g_list_remove (request->files, file);
+ g_object_unref (file);
}
if (g_atomic_int_dec_and_test (&priv->thread.n_requests))
@@ -1152,6 +1153,7 @@ tracker_monitor_set_enabled (TrackerMonitor *monitor,
request = g_new0 (MonitorRequest, 1);
request->monitor = monitor;
request->files = g_hash_table_get_keys (priv->monitored_dirs);
+ g_list_foreach (request->files, (GFunc) g_object_ref, NULL);
request->type = enabled ? MONITOR_REQUEST_ADD : MONITOR_REQUEST_REMOVE;
monitor_request_queue (monitor, request);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]