summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gobject/gsignal.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 78f878a0b..e41c60203 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -4009,6 +4009,7 @@ g_signal_accumulator_first_wins (GSignalInvocationHint *ihint,
* g_clear_signal_handler:
* @handler_id_ptr: A pointer to a handler ID (of type #gulong) of the handler to be disconnected.
* @instance: (type GObject.Object): The instance to remove the signal handler from.
+ * This pointer may be %NULL or invalid, if the handler ID is zero.
*
* Disconnects a handler from @instance so it will not be called during
* any future or currently ongoing emissions of the signal it has been
@@ -4016,21 +4017,20 @@ g_signal_accumulator_first_wins (GSignalInvocationHint *ihint,
*
* If the handler ID is 0 then this function does nothing.
*
- * A macro is also included that allows this function to be used without
- * pointer casts.
+ * There is also a macro version of this function so that the code
+ * will be inlined.
*
* Since: 2.62
*/
-#undef g_clear_signal_handler
void
-g_clear_signal_handler (gulong *handler_id_ptr,
- gpointer instance)
+(g_clear_signal_handler) (gulong *handler_id_ptr,
+ gpointer instance)
{
g_return_if_fail (handler_id_ptr != NULL);
- if (*handler_id_ptr != 0)
- {
- g_signal_handler_disconnect (instance, *handler_id_ptr);
- *handler_id_ptr = 0;
- }
+#ifndef g_clear_signal_handler
+#error g_clear_signal_handler() macro is not defined
+#endif
+
+ g_clear_signal_handler (handler_id_ptr, instance);
}