[glib] kqueue: add a bit of extra paranoia on cancel



commit 9e8f4d473604e291c0164965bf9bba5ac77cc2bf
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Mar 26 16:35:06 2015 -0400

    kqueue: add a bit of extra paranoia on cancel
    
    Cancellation of GPollFileMonitor is now handled correctly (in the sense
    that no further signals will follow) but let's be extra paranoid and
    disconnect our handler anyway, for good measure.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739424

 gio/kqueue/gkqueuefilemonitor.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/kqueue/gkqueuefilemonitor.c b/gio/kqueue/gkqueuefilemonitor.c
index 9bbbeff..78b7496 100644
--- a/gio/kqueue/gkqueuefilemonitor.c
+++ b/gio/kqueue/gkqueuefilemonitor.c
@@ -186,7 +186,10 @@ g_kqueue_file_monitor_cancel (GFileMonitor *monitor)
       kqueue_monitor->sub = NULL;
     }
   else if (kqueue_monitor->fallback)
-    g_file_monitor_cancel (kqueue_monitor->fallback);
+    {
+      g_signal_handlers_disconnect_by_func (kqueue_monitor->fallback, _fallback_callback, kqueue_monitor);
+      g_file_monitor_cancel (kqueue_monitor->fallback);
+    }
 
   if (G_FILE_MONITOR_CLASS (g_kqueue_file_monitor_parent_class)->cancel)
     (*G_FILE_MONITOR_CLASS (g_kqueue_file_monitor_parent_class)->cancel) (monitor);


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