[tracker/multi-insert: 16/16] libtracker-bus: Use the GDestroyNotify of set_res_pointer correct



commit cbdf6d29bfa7db9791f842207f3f8c7fb826e242
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Oct 11 16:03:02 2010 +0200

    libtracker-bus: Use the GDestroyNotify of set_res_pointer correct

 src/libtracker-bus/tracker-bus-fd-update.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-update.c b/src/libtracker-bus/tracker-bus-fd-update.c
index 57e40c9..a05f97d 100644
--- a/src/libtracker-bus/tracker-bus-fd-update.c
+++ b/src/libtracker-bus/tracker-bus-fd-update.c
@@ -185,8 +185,11 @@ sparql_update_fast_callback (DBusPendingCall *call,
 		break;
 	case FAST_UPDATE_BLANK:
 		result = tracker_bus_message_to_variant (reply);
-		g_simple_async_result_set_op_res_gpointer (fad->res, result, NULL);
+		g_simple_async_result_set_op_res_gpointer (fad->res,
+		                                           g_variant_ref (result),
+		                                           (GDestroyNotify) g_variant_unref);
 		g_simple_async_result_complete (fad->res);
+		fad->res = NULL;
 		g_variant_unref (result);
 
 		break;
@@ -266,8 +269,12 @@ sparql_update_array_fast_callback (DBusPendingCall *call,
 			g_ptr_array_add (errors, error);
 		}
 
-		g_simple_async_result_set_op_res_gpointer (fad->res, errors, NULL);
+			
+		g_simple_async_result_set_op_res_gpointer (fad->res,
+		                                           g_ptr_array_ref (errors),
+		                                           (GDestroyNotify) g_ptr_array_unref);
 		g_simple_async_result_complete (fad->res);
+		fad->res = NULL;
 		g_ptr_array_unref (errors);
 		break;
 	default:



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