[glib] Use g_cancellable_connect/disconnect



commit 0f48f804b665943a2fd848ab6efbe913003daa82
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Apr 20 13:14:32 2009 +0200

    Use g_cancellable_connect/disconnect
    
    Use the new cancellable helper functions to avoid races. (#572844)
---
 gio/gasynchelper.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/gio/gasynchelper.c b/gio/gasynchelper.c
index b7594dd..3e5fdf8 100644
--- a/gio/gasynchelper.c
+++ b/gio/gasynchelper.c
@@ -123,8 +123,8 @@ fd_source_finalize (GSource *source)
   FDSource *fd_source = (FDSource *)source;
 
   if (fd_source->cancelled_tag)
-    g_signal_handler_disconnect (fd_source->cancellable,
-				 fd_source->cancelled_tag);
+    g_cancellable_disconnect (fd_source->cancellable,
+			      fd_source->cancelled_tag);
 
   if (fd_source->cancellable)
     g_object_unref (fd_source->cancellable);
@@ -166,10 +166,9 @@ _g_fd_source_new (int           fd,
 
   if (cancellable)
     fd_source->cancelled_tag =
-      g_signal_connect_data (cancellable, "cancelled",
+      g_cancellable_connect (cancellable, 
 			     (GCallback)fd_source_cancelled_cb,
-			     NULL, NULL,
-			     0);
+			     NULL, NULL);
   
   return source;
 }



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