[tracker/direct-access: 106/121] libtracker-bus: Fix critical when cancellable is NULL



commit 880999e206f859b09efab07519e5f48812e43fbc
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jul 22 12:15:54 2010 +0200

    libtracker-bus: Fix critical when cancellable is NULL

 src/libtracker-bus/tracker-bus-fd-update.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-update.c b/src/libtracker-bus/tracker-bus-fd-update.c
index d90c652..47c348d 100644
--- a/src/libtracker-bus/tracker-bus-fd-update.c
+++ b/src/libtracker-bus/tracker-bus-fd-update.c
@@ -101,10 +101,12 @@ fast_async_data_new (DBusConnection    *connection,
 
 	data->connection = dbus_connection_ref (connection);
 	data->operation_type = operation_type;
-	data->cancellable = g_object_ref (cancellable);
-	data->user_data = user_data;
+	if (cancellable) {
+		data->cancellable = g_object_ref (cancellable);
 
-	data->cancelid = g_cancellable_connect (cancellable, G_CALLBACK (on_cancel), data, NULL);
+		data->cancelid = g_cancellable_connect (cancellable, G_CALLBACK (on_cancel), data, NULL);
+	}
+	data->user_data = user_data;
 
 	return data;
 }



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