[tracker/queue-fixes] tracker-store: Fix memory usage of set_active in backup/restore



commit 9ec8deebc4cc1e24bf417ef9586278f5e49d5e2e
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Nov 4 15:07:17 2010 +0200

    tracker-store: Fix memory usage of set_active in backup/restore

 src/tracker-store/tracker-backup.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-store/tracker-backup.c b/src/tracker-store/tracker-backup.c
index 02bcd8c..7a7dbe6 100644
--- a/src/tracker-store/tracker-backup.c
+++ b/src/tracker-store/tracker-backup.c
@@ -137,8 +137,10 @@ backup_idle_set_active_false_cb (gpointer user_data)
 	g_object_unref (journal);
 
 	tracker_store_set_active (TRUE, NULL, NULL);
-	if (info->resources)
+	if (info->resources) {
 		tracker_resources_enable_signals (info->resources);
+		g_object_unref (info->resources);
+	}
 }
 
 void
@@ -149,6 +151,7 @@ tracker_backup_restore (TrackerBackup          *object,
 {
 	guint request_id;
 	TrackerDBusMethodInfo *info;
+	gpointer resources;
 
 	request_id = tracker_dbus_get_next_request_id ();
 
@@ -161,10 +164,13 @@ tracker_backup_restore (TrackerBackup          *object,
 	info->request_id = request_id;
 	info->context = context;
 	info->journal_uri = g_strdup (journal_uri);
-	info->resources = TRACKER_RESOURCES (tracker_dbus_get_object (TRACKER_TYPE_RESOURCES));
+	resources = tracker_dbus_get_object (TRACKER_TYPE_RESOURCES);
 
-	if (info->resources)
+	if (resources) {
+		info->resources = g_object_ref (resources);
 		tracker_resources_disable_signals (info->resources);
+	}
+
 	tracker_store_set_active (FALSE, backup_idle_set_active_false_cb, info);
 }
 



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