[tracker/dbus-fd-experiment] libtracker-client: Restore API compatibility for updates



commit d4453b455b2eb09f0cf0c961a720ad96c81c1961
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jun 23 13:40:16 2010 +0200

    libtracker-client: Restore API compatibility for updates
    
    In libtracker-client the callbacks are responsible for freeing the
    results. This is unusual, however, we have to keep it that way to not
    break API compatibility.

 src/libtracker-client/tracker.c |   22 ++--------------------
 1 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index 4b32394..7954eca 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -1044,22 +1044,6 @@ unmarshal_hash_table (DBusMessageIter *iter)
 }
 
 static void
-unmarshal_inner_array_free (gpointer data)
-{
-	if (data) {
-		g_hash_table_unref (data);
-	}
-}
-
-static void
-unmarshal_result_free (gpointer data)
-{
-	if (data) {
-		g_ptr_array_free (data, TRUE);
-	}
-}
-
-static void
 sparql_update_fast_callback (DBusPendingCall *call,
                              void            *user_data)
 {
@@ -1113,14 +1097,14 @@ sparql_update_fast_callback (DBusPendingCall *call,
 		(* fad->void_callback) (NULL, fad->user_data);
 		break;
 	case FAST_UPDATE_BLANK:
-		result = g_ptr_array_new_with_free_func (unmarshal_result_free);
+		result = g_ptr_array_new ();
 		dbus_message_iter_init (reply, &iter);
 		dbus_message_iter_recurse (&iter, &subiter);
 
 		while (dbus_message_iter_get_arg_type (&subiter) != DBUS_TYPE_INVALID) {
 			GPtrArray *inner_array;
 
-			inner_array = g_ptr_array_new_with_free_func (unmarshal_inner_array_free);
+			inner_array = g_ptr_array_new ();
 			g_ptr_array_add (result, inner_array);
 			dbus_message_iter_recurse (&subiter, &subsubiter);
 
@@ -1134,8 +1118,6 @@ sparql_update_fast_callback (DBusPendingCall *call,
 
 		(* fad->gptrarray_callback) (result, error, fad->user_data);
 
-		g_ptr_array_free (result, TRUE);
-
 		break;
 	default:
 		g_assert_not_reached ();



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