From c09216f810eb1c578348192405abdebbf1c1b966 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 2 Dec 2022 11:59:16 +0000 Subject: [PATCH 1/2] gclosure: Use (transfer floating) for closure construction functions They return floating references, so that should be reflected in the introspection annotations. Signed-off-by: Philip Withnall --- gobject/gclosure.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gobject/gclosure.c b/gobject/gclosure.c index c5354db32..8d5d88d94 100644 --- a/gobject/gclosure.c +++ b/gobject/gclosure.c @@ -190,7 +190,7 @@ enum { * } * ]| * - * Returns: (transfer none): a floating reference to a new #GClosure + * Returns: (transfer floating): a floating reference to a new #GClosure */ GClosure* g_closure_new_simple (guint sizeof_closure, @@ -964,7 +964,7 @@ _g_closure_set_va_marshal (GClosure *closure, * * @destroy_data will be called as a finalize notifier on the #GClosure. * - * Returns: (transfer none): a floating reference to a new #GCClosure + * Returns: (transfer floating): a floating reference to a new #GCClosure */ GClosure* g_cclosure_new (GCallback callback_func, @@ -994,7 +994,7 @@ g_cclosure_new (GCallback callback_func, * * @destroy_data will be called as a finalize notifier on the #GClosure. * - * Returns: (transfer none): a floating reference to a new #GCClosure + * Returns: (transfer floating): a floating reference to a new #GCClosure */ GClosure* g_cclosure_new_swap (GCallback callback_func, @@ -1162,7 +1162,7 @@ g_type_iface_meta_marshalv (GClosure *closure, * @struct_offset in the class structure of the interface or classed type * identified by @itype. * - * Returns: (transfer none): a floating reference to a new #GCClosure + * Returns: (transfer floating): a floating reference to a new #GCClosure */ GClosure* g_signal_type_cclosure_new (GType itype, From 3df45aba2071fc23fe7ec96fe54d419bb2a5c521 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 2 Dec 2022 11:59:43 +0000 Subject: [PATCH 2/2] gsignal: Document that floating GClosures are sunk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s not clear about that otherwise. Signed-off-by: Philip Withnall --- gobject/gsignal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gobject/gsignal.c b/gobject/gsignal.c index 6fee8ec3f..dd1c6b50d 100644 --- a/gobject/gsignal.c +++ b/gobject/gsignal.c @@ -2400,6 +2400,9 @@ g_signal_get_invocation_hint (gpointer instance) * * Connects a closure to a signal for a particular object. * + * If @closure is a floating reference (see g_closure_sink()), this function + * takes ownership of @closure. + * * Returns: the handler ID (always greater than 0 for successful connections) */ gulong @@ -2462,6 +2465,9 @@ g_signal_connect_closure_by_id (gpointer instance, * * Connects a closure to a signal for a particular object. * + * If @closure is a floating reference (see g_closure_sink()), this function + * takes ownership of @closure. + * * Returns: the handler ID (always greater than 0 for successful connections) */ gulong