[tracker] libtracker-bus: plug memleak when updating, GAsyncResult should always be unref-ed



commit 310b08bed179242d55107b2c763a80d937793d0b
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Oct 18 11:41:18 2010 +0200

    libtracker-bus: plug memleak when updating, GAsyncResult should always be unref-ed

 src/libtracker-bus/tracker-bus-fd-update.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-update.c b/src/libtracker-bus/tracker-bus-fd-update.c
index 76cc8e7..158e388 100644
--- a/src/libtracker-bus/tracker-bus-fd-update.c
+++ b/src/libtracker-bus/tracker-bus-fd-update.c
@@ -69,7 +69,7 @@ fast_async_data_free (gpointer data)
 		}
 
 		if (fad->res) {
-			/* Don't free, weak */
+			g_object_unref (fad->res);
 		}
 
 		g_slice_free (FastAsyncData, fad);
@@ -187,7 +187,6 @@ sparql_update_fast_callback (DBusPendingCall *call,
 		                                           g_variant_ref (result),
 		                                           (GDestroyNotify) g_variant_unref);
 		g_simple_async_result_complete (fad->res);
-		fad->res = NULL;
 		g_variant_unref (result);
 
 		break;
@@ -273,7 +272,6 @@ sparql_update_array_fast_callback (DBusPendingCall *call,
 		                                           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:
@@ -612,7 +610,6 @@ sparql_update_fast_send (DBusConnection     *connection,
 	 if (error) {
 		 g_critical ("Could not initiate update: %s", error->message);
 		 g_error_free (error);
-		 g_object_unref (fad->res);
 		 fast_async_data_free (fad);
 	 }
  }
@@ -650,7 +647,6 @@ sparql_update_fast_send (DBusConnection     *connection,
 	if (error) {
 		g_critical ("Could not initiate update: %s", error->message);
 		g_error_free (error);
-		g_object_unref (fad->res);
 		fast_async_data_free (fad);
 	}
 }
@@ -749,7 +745,6 @@ tracker_bus_fd_sparql_update_blank_async (DBusGConnection     *connection,
 	if (error) {
 		g_critical ("Could not initiate update: %s", error->message);
 		g_error_free (error);
-		g_object_unref (fad->res);
 		fast_async_data_free (fad);
 	}
 }
@@ -799,7 +794,6 @@ tracker_bus_fd_sparql_batch_update_async (DBusGConnection       *connection,
 	if (error) {
 		g_critical ("Could not initiate update: %s", error->message);
 		g_error_free (error);
-		g_object_unref (fad->res);
 		fast_async_data_free (fad);
 	}
 }
@@ -837,7 +831,6 @@ tracker_bus_fd_sparql_batch_update_array_async (DBusGConnection      *connection
 	if (error) {
 		g_critical ("Could not initiate update: %s", error->message);
 		g_error_free (error);
-		g_object_unref (fad->res);
 		fast_async_data_free (fad);
 	}
 }



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