[tracker] Plug more leaks.



commit c66a69f7272a49331d0d997de58f2a2cf0aac780
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Sep 9 16:17:52 2009 +0200

    Plug more leaks.

 src/libtracker-common/tracker-config-file.c    |    1 +
 src/libtracker-common/tracker-keyfile-object.c |    4 ++++
 src/libtracker-miner/tracker-miner-fs.c        |    4 +++-
 src/libtracker-miner/tracker-miner.c           |    2 ++
 src/libtracker-miner/tracker-monitor.c         |    1 +
 5 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-common/tracker-config-file.c b/src/libtracker-common/tracker-config-file.c
index fbaf156..6bf6fbf 100644
--- a/src/libtracker-common/tracker-config-file.c
+++ b/src/libtracker-common/tracker-config-file.c
@@ -165,6 +165,7 @@ config_finalize (GObject *object)
 	}
 
 	if (file->monitor) {
+		g_file_monitor_cancel (file->monitor);
 		g_object_unref (file->monitor);
 	}
 
diff --git a/src/libtracker-common/tracker-keyfile-object.c b/src/libtracker-common/tracker-keyfile-object.c
index e922e36..0a9bbb3 100644
--- a/src/libtracker-common/tracker-keyfile-object.c
+++ b/src/libtracker-common/tracker-keyfile-object.c
@@ -262,6 +262,10 @@ tracker_keyfile_object_load_string_list (gpointer     object,
 	g_strfreev (value);
 	
 	g_object_set (G_OBJECT (object), property, l, NULL);
+
+	/* List is copied internally */
+	g_slist_foreach (l, (GFunc) g_free, NULL);
+	g_slist_free (l);
 }
 
 void
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index e9295c6..2cc623e 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1381,7 +1381,9 @@ crawl_directories_start (TrackerMinerFS *fs)
 		return;
 	}
 
-	fs->private->timer = g_timer_new ();
+	if (!fs->private->timer) {
+		fs->private->timer = g_timer_new ();
+	}
 
 	fs->private->directories_found = 0;
 	fs->private->directories_ignored = 0;
diff --git a/src/libtracker-miner/tracker-miner.c b/src/libtracker-miner/tracker-miner.c
index 2e9142e..9f0a64e 100644
--- a/src/libtracker-miner/tracker-miner.c
+++ b/src/libtracker-miner/tracker-miner.c
@@ -323,6 +323,8 @@ miner_finalize (GObject *object)
 		g_object_set_qdata (G_OBJECT (miner), dbus_data, NULL);
 	}
 
+	g_hash_table_destroy (miner->private->pauses);
+
 	G_OBJECT_CLASS (tracker_miner_parent_class)->finalize (object);
 }
 
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index c094e73..b29235b 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -359,6 +359,7 @@ tracker_monitor_finalize (GObject *object)
 
 	g_hash_table_unref (priv->cached_events);
 	g_hash_table_unref (priv->event_pairs);
+	g_hash_table_unref (priv->monitors);
 
 	G_OBJECT_CLASS (tracker_monitor_parent_class)->finalize (object);
 }



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