[tracker/rss-enclosures] libtracker-bus: Don't use returned variable_names in case of error
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] libtracker-bus: Don't use returned variable_names in case of error
- Date: Wed, 24 Nov 2010 01:45:32 +0000 (UTC)
commit 1e9d0eef01911c4b0c8dc4fdbc0e865768667992
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Sep 13 11:33:42 2010 +0200
libtracker-bus: Don't use returned variable_names in case of error
src/libtracker-bus/tracker-bus-fd-cursor.c | 19 +++++--------------
1 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-cursor.c b/src/libtracker-bus/tracker-bus-fd-cursor.c
index 4575d9c..64d6e38 100644
--- a/src/libtracker-bus/tracker-bus-fd-cursor.c
+++ b/src/libtracker-bus/tracker-bus-fd-cursor.c
@@ -299,13 +299,6 @@ tracker_bus_fd_query (DBusGConnection *gconnection,
&cursor->variable_names,
&inner_error);
- if (cursor->variable_names) {
- cursor->n_columns = g_strv_length (cursor->variable_names);
- } else {
- cursor->variable_names = NULL;
- cursor->n_columns = 0;
- }
-
/* message is destroyed by tracker_dbus_send_and_splice */
if (G_UNLIKELY (inner_error)) {
@@ -314,7 +307,10 @@ tracker_bus_fd_query (DBusGConnection *gconnection,
g_propagate_error (error, inner_error);
g_object_unref (cursor);
cursor = NULL;
+ } else {
+ cursor->n_columns = g_strv_length (cursor->variable_names);
}
+
return TRACKER_SPARQL_CURSOR (cursor);
#else /* HAVE_DBUS_FD_PASSING */
g_assert_not_reached ();
@@ -346,13 +342,8 @@ query_async_cb (gpointer buffer,
cursor->buffer = buffer;
cursor->buffer_size = buffer_size;
- if (variable_names) {
- cursor->variable_names = g_strdupv (variable_names);
- cursor->n_columns = g_strv_length (cursor->variable_names);
- } else {
- cursor->variable_names = NULL;
- cursor->n_columns = 0;
- }
+ cursor->variable_names = g_strdupv (variable_names);
+ cursor->n_columns = g_strv_length (cursor->variable_names);
g_simple_async_result_set_op_res_gpointer (res, cursor, g_object_unref);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]