[glib] gsignal: add g_signal_handlers_disconnect_by_data



commit cf48434867bf6fa074f9a0a67cf03b5c2157170a
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jan 19 09:01:08 2012 -0500

    gsignal: add g_signal_handlers_disconnect_by_data
    
    Similar to g_signal_handlers_disconnect_by_func() but disconnects all
    functions that use the given user_data.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668269

 gobject/gsignal.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gsignal.h b/gobject/gsignal.h
index 63390f5..73dcf47 100644
--- a/gobject/gsignal.h
+++ b/gobject/gsignal.h
@@ -472,6 +472,21 @@ void   g_signal_chain_from_overridden_handler (gpointer           instance,
     g_signal_handlers_disconnect_matched ((instance),								\
 					  (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA),	\
 					  0, 0, NULL, (func), (data))
+
+/**
+ * g_signal_handlers_disconnect_by_data:
+ * @instance: The instance to remove handlers from
+ * @data: the closure data of the handlers' closures
+ *
+ * Disconnects all handlers on an instance that match @data.
+ *
+ * Returns: The number of handlers that matched.
+ *
+ * Since: 2.32
+ */
+#define g_signal_handlers_disconnect_by_data(instance, data) \
+  g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data))
+
 /**
  * g_signal_handlers_block_by_func:
  * @instance: The instance to block handlers from.



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