[tracker/rss-enclosures] libtracker-miner, miners/rss, plugins/evolution: Fixed memory leaks for cursors
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] libtracker-miner, miners/rss, plugins/evolution: Fixed memory leaks for cursors
- Date: Wed, 24 Nov 2010 01:18:25 +0000 (UTC)
commit 3ffca87da1247b690a233469c6f6e72fe6933221
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Aug 2 15:17:42 2010 +0200
libtracker-miner, miners/rss, plugins/evolution: Fixed memory leaks for cursors
src/libtracker-miner/tracker-miner-fs.c | 19 ++++++++++++++++++-
src/plugins/evolution/tracker-evolution-plugin.c | 6 +++---
2 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 40ecb52..3b62cb2 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1095,11 +1095,16 @@ item_query_exists_cb (GObject *object,
if (error) {
g_critical ("Could not execute sparql query: %s", error->message);
g_error_free (error);
+ if (cursor) {
+ g_object_unref (cursor);
+ }
return;
}
- if (!tracker_sparql_cursor_next (cursor, NULL, NULL))
+ if (!tracker_sparql_cursor_next (cursor, NULL, NULL)) {
+ g_object_unref (cursor);
return;
+ }
n_results = 1;
data->iri = g_strdup (tracker_sparql_cursor_get_string (cursor, 0, NULL));
@@ -1122,6 +1127,8 @@ item_query_exists_cb (GObject *object,
tracker_sparql_cursor_get_string (cursor, 0, NULL),
data->get_mime ? tracker_sparql_cursor_get_string (cursor, 1, NULL) : "unneeded");
}
+
+ g_object_unref (cursor);
}
static gboolean
@@ -1193,6 +1200,9 @@ cache_query_cb (GObject *object,
if (G_UNLIKELY (error)) {
g_critical ("Could not execute cache query: %s", error->message);
g_error_free (error);
+ if (cursor) {
+ g_object_unref (cursor);
+ }
return;
}
@@ -1205,6 +1215,8 @@ cache_query_cb (GObject *object,
file,
g_strdup (tracker_sparql_cursor_get_string (cursor, 1, NULL)));
}
+
+ g_object_unref (cursor);
}
static gboolean
@@ -1746,6 +1758,9 @@ item_update_children_uri_cb (GObject *object,
if (error) {
g_critical ("Could not query children: %s", error->message);
g_error_free (error);
+ if (cursor) {
+ g_object_unref (cursor);
+ }
} else {
while (tracker_sparql_cursor_next (cursor, NULL, NULL)) {
const gchar *child_source_uri, *child_mime, *child_urn;
@@ -1784,6 +1799,8 @@ item_update_children_uri_cb (GObject *object,
}
}
+ g_object_unref (cursor);
+
g_main_loop_quit (data->main_loop);
}
diff --git a/src/plugins/evolution/tracker-evolution-plugin.c b/src/plugins/evolution/tracker-evolution-plugin.c
index d3a4ca7..e3f585f 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.c
+++ b/src/plugins/evolution/tracker-evolution-plugin.c
@@ -1751,7 +1751,7 @@ on_register_client_qry (GObject *source_object,
g_error_free (error);
g_slice_free (ClientRegistry, info);
if (cursor) {
- //g_object_unref (cursor);
+ g_object_unref (cursor);
}
return;
}
@@ -1774,7 +1774,7 @@ on_register_client_qry (GObject *source_object,
if (new_error) {
g_warning ("%s", new_error->message);
g_error_free (error);
- //g_object_unref (cursor);
+ g_object_unref (cursor);
return;
}
@@ -1784,7 +1784,7 @@ on_register_client_qry (GObject *source_object,
register_client_second_half (info);
- //g_object_unref (cursor);
+ g_object_unref (cursor);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]