From 2b3e7f2dc1227504f902b4fef67571fc309675dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Corentin=20No=C3=ABl?= Date: Wed, 2 Oct 2024 11:11:48 +0200 Subject: [PATCH] gobject-2.0: Fix GWeakRef not having a copy function Add its private field to allow to actually generate a copy function. Note that the generated copy function does not call g_weak_ref_init which is required for a real copy. --- vapi/gobject-2.0.vapi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vapi/gobject-2.0.vapi b/vapi/gobject-2.0.vapi index b3812febf..82060a564 100644 --- a/vapi/gobject-2.0.vapi +++ b/vapi/gobject-2.0.vapi @@ -858,12 +858,14 @@ namespace GLib { public static bool type_transformable (GLib.Type src_type, GLib.Type dest_type); public void unset (); } - [CCode (cheader_filename = "glib-object.h", destroy_function = "g_weak_ref_clear", has_type_id = false, lvalue_access = false)] + [CCode (cheader_filename = "glib-object.h", has_copy_function = false, destroy_function = "g_weak_ref_clear", has_type_id = false, lvalue_access = false)] [Version (since = "2.32")] public struct WeakRef { public WeakRef (GLib.Object? object); public GLib.Object? @get (); public void @set (GLib.Object? object); + [CCode (cname = "priv.p")] + private void* p; } [CCode (cheader_filename = "glib-object.h", cprefix = "G_BINDING_", type_id = "G_TYPE_BINDING_FLAGS")] [Flags] -- 2.47.2