tracker r1821 - in branches/indexer-split: . src/libtracker-common src/trackerd



Author: mr
Date: Wed Jul  2 11:52:07 2008
New Revision: 1821
URL: http://svn.gnome.org/viewvc/tracker?rev=1821&view=rev

Log:
	* src/libtracker-common/tracker-module-config.c:
	* src/trackerd/tracker-crawler.c:
	* src/trackerd/tracker-monitor.c: Plugged leaks which took the
	memory lost from 1.8Mb (33,498 blocks) to 36 bytes (1 block). Good
	old valgrind!


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/tracker-module-config.c
   branches/indexer-split/src/trackerd/tracker-crawler.c
   branches/indexer-split/src/trackerd/tracker-monitor.c

Modified: branches/indexer-split/src/libtracker-common/tracker-module-config.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-module-config.c	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-module-config.c	Wed Jul  2 11:52:07 2008
@@ -458,6 +458,7 @@
 		child = g_file_get_child (file, name);
 		filename = g_file_get_path (child);
 		mc = module_config_load_file (filename);
+		g_free (filename);
 
 		if (mc) {
 			gchar *name_stripped;
@@ -543,6 +544,7 @@
 	/* Get modules */
 	if (!module_config_load ()) {
 		g_hash_table_unref (modules);
+		g_free (path);
 		return FALSE;
 	}
 
@@ -561,6 +563,7 @@
 			  NULL);
 
 	g_object_unref (file);
+	g_free (path);
 
 	initiated = TRUE;
 

Modified: branches/indexer-split/src/trackerd/tracker-crawler.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-crawler.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-crawler.c	Wed Jul  2 11:52:07 2008
@@ -576,6 +576,8 @@
 
 		g_queue_push_tail (crawler->private->files, g_object_ref (file));
 	}
+
+	g_free (path);
 }
 
 static void
@@ -607,6 +609,8 @@
 
 		g_queue_push_tail (crawler->private->directories, g_object_ref (file));
 	}
+
+	g_free (path);
 }
 
 static void
@@ -614,13 +618,18 @@
 			GError     *error,
 			gpointer    user_data)
 {
+	GStrv files;
+
 	if (error) {
-		g_critical ("Could not send files to indexer to check, %s",
-			    error->message);
+		g_message ("Files could not be checked by the indexer, %s",
+			   error->message);
 		g_error_free (error);
 	} else {
 		g_debug ("Sent!");
 	}
+
+	files = (GStrv) user_data;
+	g_strfreev (files);
 }
 
 static void
@@ -654,10 +663,10 @@
 		 total);
 
 	org_freedesktop_Tracker_Indexer_files_check_async (proxy,
-							   g_strdup (crawler->private->current_module_name),
+							   crawler->private->current_module_name,
 							   (const gchar **) files,
 							   indexer_check_files_cb,
-							   NULL);
+							   files);
 
 	g_object_unref (crawler);
 }

Modified: branches/indexer-split/src/trackerd/tracker-monitor.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-monitor.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-monitor.c	Wed Jul  2 11:52:07 2008
@@ -246,8 +246,6 @@
 {
 	GStrv files;
 	
-	files = (GStrv) user_data;
-
 	if (error) {
 		g_critical ("Could not send %d files to indexer, %s", 
 			    g_strv_length (files),
@@ -256,6 +254,9 @@
 	} else {
 		g_debug ("Sent!");
 	}
+
+	files = (GStrv) user_data;
+	g_strfreev (files);
 }
 
 static void



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