tracker r1343 - branches/indexer-split/src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1343 - branches/indexer-split/src/trackerd
- Date: Mon, 5 May 2008 10:46:37 +0100 (BST)
Author: pvanhoof
Date: Mon May 5 09:46:37 2008
New Revision: 1343
URL: http://svn.gnome.org/viewvc/tracker?rev=1343&view=rev
Log:
A few leak fixes
Modified:
branches/indexer-split/src/trackerd/tracker-db-sqlite.c
branches/indexer-split/src/trackerd/tracker-xesam-live-search.c
branches/indexer-split/src/trackerd/tracker-xesam.c
Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.c Mon May 5 09:46:37 2008
@@ -3331,8 +3331,8 @@
result = tracker_exec_proc (db_con->common, "GetEvents", NULL);
tracker_debug ("SetEventsBeingHandled");
result_set = tracker_exec_proc (db_con->common, "SetEventsBeingHandled", NULL);
- g_object_unref (result_set);
-
+ if (result_set)
+ g_object_unref (result_set);
g_static_rec_mutex_unlock (&events_table_lock);
return result;
@@ -3350,7 +3350,8 @@
tracker_debug ("DeleteHandledEvents");
result_set = tracker_exec_proc (db_con->common, "DeleteHandledEvents", NULL);
- g_object_unref (result_set);
+ if (result_set)
+ g_object_unref (result_set);
g_static_rec_mutex_unlock (&events_table_lock);
@@ -3405,7 +3406,7 @@
guint32
tracker_db_create_service (DBConnection *db_con, const char *service, TrackerDBFileInfo *info)
{
- TrackerDBResultSet *result_set;
+ TrackerDBResultSet *result_set, *b;
int i;
guint32 id = 0;
char *sid;
@@ -3449,9 +3450,13 @@
i++;
sid = tracker_int_to_string (i);
- tracker_exec_proc (db_con->common, "UpdateNewID", sid, NULL);
+ b = tracker_exec_proc (db_con->common, "UpdateNewID", sid, NULL);
- g_object_unref (result_set);
+ if (b)
+ g_object_unref (b);
+
+ if (result_set)
+ g_object_unref (result_set);
if (info->is_directory) {
str_is_dir = "1";
@@ -3487,12 +3492,15 @@
// gchar *apath = tracker_escape_string (path);
// gchar *aname = tracker_escape_string (name);
- tracker_exec_proc (db_con, "CreateService", sid, path, name,
+ b = tracker_exec_proc (db_con, "CreateService", sid, path, name,
str_service_type_id, info->mime, str_filesize,
str_is_dir, str_is_link, str_offset, str_mtime, str_aux, NULL);
// g_free (apath);
// g_free (aname);
+ if (b)
+ g_object_unref (b);
+
if (db_con->in_error) {
tracker_error ("ERROR: CreateService uri is %s/%s", path, name);
g_free (name);
@@ -3514,12 +3522,17 @@
(int) id);
}
- tracker_exec_proc (db_con->common, "IncStat", service, NULL);
+ b = tracker_exec_proc (db_con->common, "IncStat", service, NULL);
+
+ if (b)
+ g_object_unref (b);
parent = tracker_service_manager_get_parent_service (service);
if (parent) {
- tracker_exec_proc (db_con->common, "IncStat", parent, NULL);
+ b = tracker_exec_proc (db_con->common, "IncStat", parent, NULL);
+ if (b)
+ g_object_unref (b);
g_free (parent);
}
Modified: branches/indexer-split/src/trackerd/tracker-xesam-live-search.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-xesam-live-search.c (original)
+++ branches/indexer-split/src/trackerd/tracker-xesam-live-search.c Mon May 5 09:46:37 2008
@@ -207,6 +207,9 @@
result_set = tracker_db_get_live_search_modified_ids (db_con,
tracker_xesam_live_search_get_id (self));
+ if (!result_set)
+ return;
+
while (ls_valid) {
GValue ls_value = { 0, };
gboolean ev_valid = TRUE;
@@ -262,6 +265,9 @@
"", /* Tables */
tracker_xesam_live_search_get_query (self)); /* Query */
+ if (!result_set)
+ return;
+
while (ls_valid) {
GValue ls_value = { 0, };
GValue ev_type = { 0, };
Modified: branches/indexer-split/src/trackerd/tracker-xesam.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-xesam.c (original)
+++ branches/indexer-split/src/trackerd/tracker-xesam.c Mon May 5 09:46:37 2008
@@ -158,7 +158,7 @@
result_set = tracker_db_get_events (db_con);
- if (tracker_db_result_set_get_n_rows (result_set) > 0) {
+ if (result_set && tracker_db_result_set_get_n_rows (result_set) > 0) {
reason_to_live = TRUE;
@@ -197,7 +197,8 @@
tracker_db_delete_handled_events (db_con, result_set);
}
- g_object_unref (result_set);
+ if (result_set)
+ g_object_unref (result_set);
return reason_to_live;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]