From cf48434867bf6fa074f9a0a67cf03b5c2157170a Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 19 Jan 2012 09:01:08 -0500 Subject: [PATCH] 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 file changed, 15 insertions(+) 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. -- 2.7.4