]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Emit G_DEFINE_AUTOPTR_CLEANUP_FUNC() for interfaces with base class
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 24 Feb 2022 12:45:18 +0000 (13:45 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 17 Mar 2022 10:52:20 +0000 (11:52 +0100)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1292

64 files changed:
codegen/valagtypemodule.vala
tests/annotations/deprecated.c-expected
tests/asynchronous/bug614294.c-expected
tests/asynchronous/bug646945.c-expected
tests/asynchronous/bug652252.c-expected
tests/asynchronous/nowrapper.c-expected
tests/dbus/arrays_client.c-expected
tests/dbus/async-bus_client.c-expected
tests/dbus/async-connection_client.c-expected
tests/dbus/async-errors_client.c-expected
tests/dbus/async-no-reply_client.c-expected
tests/dbus/async_client.c-expected
tests/dbus/basic-types_client.c-expected
tests/dbus/bug602003_client.c-expected
tests/dbus/bug735437_client.c-expected
tests/dbus/bug782719_client.c-expected
tests/dbus/bug783002_client.c-expected
tests/dbus/bug792277.c-expected
tests/dbus/connection_client.c-expected
tests/dbus/dicts_client.c-expected
tests/dbus/dicts_server.c-expected
tests/dbus/enum-string-marshalling.c-expected
tests/dbus/errors_client.c-expected
tests/dbus/filedescriptor-async_client.c-expected
tests/dbus/filedescriptor-errors_client.c-expected
tests/dbus/filedescriptor_client.c-expected
tests/dbus/generics_client.c-expected
tests/dbus/interface-info_client.c-expected
tests/dbus/no-reply_client.c-expected
tests/dbus/rawvariants_client.c-expected
tests/dbus/signals_client.c-expected
tests/dbus/structs_client.c-expected
tests/delegates/compatible.c-expected
tests/delegates/delegates.c-expected
tests/generics/bug640330.c-expected
tests/genie/interface.c-expected
tests/methods/bug648320.c-expected
tests/methods/bug652098.c-expected
tests/methods/generics.c-expected
tests/methods/nowrapper-interface.c-expected
tests/objects/bug641828.c-expected
tests/objects/bug642809.c-expected
tests/objects/bug779219.c-expected
tests/objects/class-new-no-override.c-expected
tests/objects/classes-implicit-implementation.c-expected
tests/objects/classes-interfaces-virtuals.c-expected
tests/objects/classes-interfaces.c-expected
tests/objects/instance-comparison.c-expected
tests/objects/interface-abstract-async-override.c-expected
tests/objects/interface-async-captured-generic.c-expected
tests/objects/interface-generics.c-expected
tests/objects/interface-property-base-impl.c-expected
tests/objects/interface-property-override.c-expected
tests/objects/interface-virtual-override.c-expected
tests/objects/interfaces.c-expected
tests/objects/methods.c-expected
tests/objects/properties.c-expected
tests/objects/property-read-only-auto.c-expected
tests/objects/signals-fundamental-return.c-expected
tests/objects/signals-gobject-return.c-expected
tests/objects/type-narrowing-fallback.c-expected
tests/resolver/peek-inner-types.c-expected
tests/structs/bug667890.c-expected
tests/structs/gvalue.c-expected

index 1f600afe3fd6992ca3fb0e7328531e87dcd1723f..28a29744c04b8ada9edd02cd00735d37231c1135 100644 (file)
@@ -2148,8 +2148,9 @@ public class Vala.GTypeModule : GErrorModule {
                decl_space.add_type_declaration (new CCodeTypeDefinition ("struct _%s".printf (get_ccode_name (iface)), new CCodeVariableDeclarator (get_ccode_name (iface))));
                decl_space.add_type_declaration (new CCodeTypeDefinition ("struct %s".printf (type_struct.name), new CCodeVariableDeclarator (get_ccode_type_name (iface))));
 
+               unowned Class? prereq_cl = null;
                foreach (DataType prerequisite in iface.get_prerequisites ()) {
-                       unowned Class? prereq_cl = prerequisite.type_symbol as Class;
+                       prereq_cl = prerequisite.type_symbol as Class;
                        unowned Interface? prereq_iface = prerequisite.type_symbol as Interface;
                        if (prereq_cl != null) {
                                generate_class_declaration (prereq_cl, decl_space);
@@ -2216,6 +2217,16 @@ public class Vala.GTypeModule : GErrorModule {
                decl_space.add_type_member_declaration (type_fun.get_declaration ());
 
                requires_vala_extern = true;
+
+               if (prereq_cl != null) {
+                       var base_class = prereq_cl;
+                       while (base_class.base_class != null) {
+                               base_class = base_class.base_class;
+                       }
+                       // Custom unref-methods need to be emitted before G_DEFINE_AUTOPTR_CLEANUP_FUNC,
+                       // so we guard against that special case and handle it in generate_method_declaration.
+                       generate_autoptr_cleanup (iface, base_class, decl_space);
+               }
        }
 
        public override void visit_interface (Interface iface) {
index 729cd82e44467dcbfecc5ef16f31fc76a2d24af9..d7844cc8498a3318405dd9df0991dcc21833a740 100644 (file)
@@ -148,6 +148,7 @@ static gint afoo_real_fooa (AFoo* self) G_GNUC_DEPRECATED ;
 VALA_EXTERN AFoo* afoo_construct (GType object_type);
 static GType afoo_get_type_once (void);
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gint ifoo_foo (IFoo* self) G_GNUC_DEPRECATED ;
 VALA_EXTERN void ifoo_fooa (IFoo* self) G_GNUC_DEPRECATED ;
 static GType ifoo_get_type_once (void);
index 4845677fda3048cb47acb04e1ec0fd8c592e8747..e7fed1b7774dbba02d0d37a31b0264bad3e2ef9b 100644 (file)
@@ -231,6 +231,7 @@ static gpointer baz_parent_class = NULL;
 static gpointer sub_baz_parent_class = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN void ifoo_foo_async (IFoo* self,
                      GAsyncReadyCallback _callback_,
                      gpointer _user_data_);
index 525f44f3c722f48374d2942b412bc616f6d3c113..059812076a20311f5c52b0de3057574e32113360 100644 (file)
@@ -137,6 +137,7 @@ VALA_EXTERN Foo* foo_new (void);
 VALA_EXTERN Foo* foo_construct (GType object_type);
 static GType foo_get_type_once (void);
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
 static void bar_real_method2_data_free (gpointer _data);
 static void bar_real_method2 (Bar* self,
                        GAsyncReadyCallback _callback_,
index 7494b39ef0809ca7bdb7aff908e2b6f66ecbbc59..130644d03f2891a607d63f289e64dfbc8b155e8b 100644 (file)
@@ -76,6 +76,7 @@ static gpointer bar_parent_class = NULL;
 static FooIface * bar_foo_parent_iface = NULL;
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 static void foo_real_foo_data_free (gpointer _data);
 static void foo_real_foo (Foo* self,
                    GAsyncReadyCallback _callback_,
index 8b388a6ff6c7d8eb66aca864af92d34b851c3339..f329368d84c7bc1f843d5272c9eab9053b4d849a 100644 (file)
@@ -94,6 +94,7 @@ VALA_EXTERN GMainLoop* loop;
 GMainLoop* loop = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
index 8c17358f02161d2718ea7534d7ce5d8d829a6241..92367812b087634b92c7686bf260bbfa22455318 100644 (file)
@@ -48,6 +48,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gint* test_test_int (Test* self,
                      gint* i,
                      gint i_length1,
index 5bc147231caa1997c59e21acbbbdf31824ebbeae..1b409500d8fa81597f18b1b8e80b54f44ebec3a2 100644 (file)
@@ -48,6 +48,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gint test_get_test (Test* self,
                     GError** error);
 static GType test_get_type_once (void);
index 30ee60393c50eca95dbb440fa1e3291137151855..b96d7b7e608c12e507ff423a86d7393ae36abb9a 100644 (file)
@@ -48,6 +48,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gint test_get_test (Test* self,
                     GError** error);
 static GType test_get_type_once (void);
index 93025ba4a92412e607b1670b7267c3fa1598a243..3e5d988fd26e9c6e6764e1c93a756de0e4033714 100644 (file)
@@ -102,6 +102,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_void (Test* self,
                      GAsyncReadyCallback _callback_,
                      gpointer _user_data_);
index abb397e7d24178ca96f01269a66d19b24f306ccd..4e92668b590c1f52dcd640a56cd05a581fb6a0fe 100644 (file)
@@ -129,6 +129,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_list_messages (Test* self,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_);
index 5a52c2642b00c7a762c72f26317cf904b5ca5ebb..7323abbb739881a5b3754f3287a30e8b5bf39661 100644 (file)
@@ -100,6 +100,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_void (Test* self,
                      GAsyncReadyCallback _callback_,
                      gpointer _user_data_);
index fb410ddd138294e6e24137fe92f05b07bd8ce1d0..f05900aa8bd0f99a72d115a6c012c25e3a599253 100644 (file)
@@ -52,6 +52,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_void (Test* self,
                      GError** error);
 VALA_EXTERN gint test_test_int (Test* self,
index 86d159c796d335bbaa1a6940634c63d61fe4d48b..421f4b1cd4d3802cabd98d891e15cc9400759adb 100644 (file)
@@ -46,6 +46,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN GVariant* test_test_string (Test* self,
                             GError** error);
 static GType test_get_type_once (void);
index dae32bff8a963a0734e6946edd5492611557cee7..0628ec36ee9c9e84fec571221d6831341579c0af 100644 (file)
@@ -49,6 +49,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gdouble* test_array (Test* self,
                      gint* result_length1,
                      GError** error);
index 3c287d61759119ea89a00e15f819254b048ee984..97670f943b917823dba358532cd6d0d984c42702 100644 (file)
@@ -47,6 +47,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN GHashTable* test_test_nested_dict (Test* self,
                                    GError** error);
 static GType test_get_type_once (void);
index f87ad4c6a22fe4fce5de8b5e8814822df1fbced5..afa5b06df34dedf468f953771d3de3bdbec38b94 100644 (file)
@@ -81,6 +81,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_array_lifetime (Test* self,
                                gchar** items,
                                gint items_length1,
index 63cea38d32db7836020b6bbf0c3d070ce32f8df1..cfef67e0fc51c10c70f01f651eef9b48e06c34bd 100644 (file)
@@ -68,6 +68,7 @@ VALA_EXTERN guint ifoo_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN void ifoo_method0 (IFoo* self,
                    GError** error);
 VALA_EXTERN void ifoo_method1 (IFoo* self,
index d25dbb971514d5c8b494a9f8324befd5b19e6345..ba855bb3231387faffaa1fb9fb39bc2c3cace1e9 100644 (file)
@@ -44,6 +44,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gint test_get_test (Test* self,
                     GError** error);
 static GType test_get_type_once (void);
index 16a66e5c410e9c8849a3afa1f6a9765781490823..7d085ec04c0e3216a7761c5042b739dce2a15783 100644 (file)
@@ -47,6 +47,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN GHashTable* test_test_dict (Test* self,
                             GError** error);
 static GType test_get_type_once (void);
index 90cafa765c379f018ef7cc1caa99fb3d67ff5dad..fe6f13c81072a9a2aaf72a76695f4b86cfd70c3d 100644 (file)
@@ -145,6 +145,7 @@ VALA_EXTERN guint test_interface_bar_register_object (void* object,
                                           const gchar* path,
                                           GError** error);
 VALA_EXTERN GType test_interface_bar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (TestInterfaceBar, g_object_unref)
 VALA_EXTERN GHashTable* test_interface_bar_foo (TestInterfaceBar* self,
                                     GError** error);
 static GType test_interface_bar_get_type_once (void);
index bf75b7b5aeeb6e8ac84cd7994894efab2ae8107c..6de15c4ef9f674a1be029c29f6c7a5792c0ac3a9 100644 (file)
@@ -67,6 +67,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test1 (Test* self,
                  FooEnum e,
                  GAsyncReadyCallback _callback_,
index 8971ec0c112e1adc254ede832fed402141d75817..75776f33d84c9144221b9d84869b05ede8cedaa5 100644 (file)
@@ -58,6 +58,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_void (Test* self,
                      GError** error);
 VALA_EXTERN gint test_test_int (Test* self,
index 5d00e4e240c656f941d87ac1e6b58e7fb57ccd2f..080e712a144456755812904d8b421b38925d96dd 100644 (file)
@@ -117,6 +117,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_in (Test* self,
                    GUnixInputStream* i,
                    GAsyncReadyCallback _callback_,
index 561f3d7ba3e2251962aa41a7000801afb27887fb..4986cd81ecf65e26f351367f1c3f463eff55d1b4 100644 (file)
@@ -46,6 +46,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gchar* test_test (Test* self,
                   GUnixOutputStream* output_stream,
                   GError** error);
index 0bde11a8ba39e9074ecbef77b501d5bbab539d65..08914080cac5e19c45fc8df0389d7a5ea6910748 100644 (file)
@@ -47,6 +47,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN GUnixInputStream* test_test_in (Test* self,
                                 GUnixInputStream* i,
                                 GUnixInputStream** j,
index eaada2f078c8fb7a446bd2c797e2fe12398627cb..939c7390ef6789e19c2f4e86b349d48109f4ae8b 100644 (file)
@@ -45,6 +45,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gint test_get_test (Test* self,
                     GError** error);
 static GType test_get_type_once (void);
index 9ae2ff2b7436d6ee888f8f83e34c61d502341e8f..6c925c7ad37bdb7353e3036f6d81e07715cc4605 100644 (file)
@@ -48,6 +48,7 @@ VALA_EXTERN GMainLoop* main_loop;
 GMainLoop* main_loop = NULL;
 
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN GType test_proxy_get_type (void) G_GNUC_CONST ;
 VALA_EXTERN guint test_register_object (void* object,
                             GDBusConnection* connection,
index 106c9a2b2959623d83ad48df2dbf5ea587dfb8ba..de9917d322101ae53e4566127d0056f1c8bcc296 100644 (file)
@@ -117,6 +117,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gchar** test_list_messages (Test* self,
                             gint* result_length1,
                             GError** error);
index 287614547078d0ba3f6902321dd0241a1241f022..7fc0896361420c92b245c429e5faad9a3f01694e 100644 (file)
@@ -91,6 +91,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN gint test_test_method (Test* self,
                        gint j,
                        gint k,
@@ -152,6 +153,7 @@ VALA_EXTERN guint test_raw_register_object (void* object,
                                 const gchar* path,
                                 GError** error);
 VALA_EXTERN GType test_raw_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (TestRaw, g_object_unref)
 VALA_EXTERN GVariant* test_raw_test_method (TestRaw* self,
                                 GVariant* j,
                                 GVariant* k,
index b172477d0eca960cc0cdefe8c24932a4665451e1..327f06ea10e331ddba8b377f18498cded31a84ff 100644 (file)
@@ -57,6 +57,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_do_foo (Test* self,
                   gint i,
                   GError** error);
index 91c61053a51257f5c6028ac9c0e4f6fd9dda588c..f2a1411e3b742e0992c5cd5bf44e1a38f03095b8 100644 (file)
@@ -65,6 +65,7 @@ VALA_EXTERN guint test_register_object (void* object,
                             const gchar* path,
                             GError** error);
 VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN void test_test_struct (Test* self,
                        FooStruct* f,
                        FooStruct* g,
index 249a056094348cca77acb27057eeef130893fc4d..ee7bce280e4ffc9dace9ee867ddfbd6467c3c93a 100644 (file)
@@ -59,6 +59,7 @@ static gpointer bar_parent_class = NULL;
 static FooIface * bar_foo_parent_iface = NULL;
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 VALA_EXTERN void foo_foo (Foo* self,
               Func func,
               gpointer func_target);
index ae52846d0210364ab1cb94123b1def5811d4c152..d787b8d9fd8bd667bf6f1871f54af6e0c03b76b8 100644 (file)
@@ -94,6 +94,7 @@ VALA_EXTERN GType maman_delegate_struct_get_type (void) G_GNUC_CONST ;
 VALA_EXTERN MamanDelegateStruct* maman_delegate_struct_dup (const MamanDelegateStruct* self);
 VALA_EXTERN void maman_delegate_struct_free (MamanDelegateStruct* self);
 VALA_EXTERN GType maman_foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanFoo, g_object_unref)
 VALA_EXTERN void maman_foo_foo_method (MamanFoo* self,
                            gint i);
 static GType maman_foo_get_type_once (void);
index 58433fd4539b22a23b97cfe57500e5fa2d60f6af..313cf24ba8007658f8ab1504cb477d9e47bf4398 100644 (file)
@@ -77,6 +77,7 @@ static gpointer bar_parent_class = NULL;
 static FooIface * bar_foo_parent_iface = NULL;
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 VALA_EXTERN gpointer foo_get_foo (Foo* self,
                       gconstpointer g);
 static gpointer foo_real_get_foo (Foo* self,
index 77b98c6fcd98d6fb9617136dfc3ab3328f0d4ea9..a96884723377a09c09e062b6ed077068229edb6c 100644 (file)
@@ -69,6 +69,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref)
 VALA_EXTERN Test* test_new (void);
 VALA_EXTERN Test* test_construct (GType object_type);
 VALA_EXTERN GType itest_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (ITest, g_object_unref)
 VALA_EXTERN gboolean itest_test (ITest* self,
                      gint a);
 static GType itest_get_type_once (void);
index 272b547c880b4e5b119e52278e8ff192a0be18cc..40f55db0d467357aea71828b863bee58a5d923fc 100644 (file)
@@ -37,6 +37,7 @@ struct _Block1Data {
 };
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 VALA_EXTERN void foo_foo (Foo* self);
 static Block1Data* block1_data_ref (Block1Data* _data1_);
 static void block1_data_unref (void * _userdata_);
index 81acc0910e5ca5b3f611ae52e54f7d6a1e4acfb3..c6c1cb424cf4831076e7a7891afb177ead54d8fe 100644 (file)
@@ -169,9 +169,11 @@ static gpointer concrete_parent_class = NULL;
 static IfaceIface * concrete_iface_parent_iface = NULL;
 
 VALA_EXTERN GType iface1_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Iface1, g_object_unref)
 VALA_EXTERN gint iface1_foo (Iface1* self);
 static GType iface1_get_type_once (void);
 VALA_EXTERN GType iface2_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Iface2, g_object_unref)
 VALA_EXTERN gint iface2_foo (Iface2* self);
 static GType iface2_get_type_once (void);
 VALA_EXTERN GType obj1_get_type (void) G_GNUC_CONST ;
@@ -195,6 +197,7 @@ VALA_EXTERN Base* base_new (void);
 VALA_EXTERN Base* base_construct (GType object_type);
 static GType base_get_type_once (void);
 VALA_EXTERN GType iface_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Iface, g_object_unref)
 VALA_EXTERN gint iface_foo (Iface* self);
 static GType iface_get_type_once (void);
 VALA_EXTERN GType concrete_get_type (void) G_GNUC_CONST ;
index 5cf5065b2ea7cb97f6a2158d5e7d18f5043af909..d2dafb79819d775814bd946acb92d749fb3f2fcf 100644 (file)
@@ -90,6 +90,7 @@ static gpointer baz_parent_class = NULL;
 static FooIface * baz_foo_parent_iface = NULL;
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 VALA_EXTERN void foo_foo (Foo* self,
               GType t_type,
               GBoxedCopyFunc t_dup_func,
index a3ba046f34d56210f4bf3697308df1dc5552a5f0..72faa1f09199bbbeeab9609db2991b32318e9cb7 100644 (file)
@@ -61,6 +61,7 @@ static gpointer foo_parent_class = NULL;
 static IFooIface * foo_ifoo_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
index cc9b533ec094b2ae3b64b64406d80273fc9363be..84e6cc9b064c88315a27a0de8ef7ce7ff51f40bd 100644 (file)
@@ -65,6 +65,7 @@ static gpointer foo_parent_class = NULL;
 static BarIface * foo_bar_parent_iface = NULL;
 
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
 static void g_cclosure_user_marshal_INT__INT (GClosure * closure,
                                        GValue * return_value,
                                        guint n_param_values,
index 1ca3ce3617f525053422b9653be95db9f46be987..338eff9b1124bc5359ba97fad8db87082b723099 100644 (file)
@@ -88,6 +88,7 @@ static gpointer manam_parent_class = NULL;
 static FooIface * manam_foo_parent_iface = NULL;
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 static void foo_real_virtual_signal (Foo* self);
 static GType foo_get_type_once (void);
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
index e16787701bdab829b8b591bb10a806561861d30b..7beb224edc2d56b2e62280db786c08229925776b 100644 (file)
@@ -90,6 +90,7 @@ static IFooIface * foo_ifoo_parent_iface = NULL;
 static gpointer bar_parent_class = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gint ifoo_get_foo (IFoo* self);
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
index 370467a6873b3d0624cde7ef550ecc3c8340ba91..2fb2b75839cad0657abe1dba5676c3e1623327aa 100644 (file)
@@ -64,6 +64,7 @@ static gpointer bar_parent_class = NULL;
 static IFooIface * bar_ifoo_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN void ifoo_foo (IFoo* self,
                gint i);
 static void ifoo_real_foo (IFoo* self,
index bbd01232fe2c2d56bff96d8188df89d7088cb72a..57bf0e67563155b9fdbd6bf092fba682ee189cc7 100644 (file)
@@ -153,9 +153,11 @@ static IFooIface * faz_ifoo_parent_iface = NULL;
 static IBarIface * faz_ibar_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gint ifoo_foo (IFoo* self);
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType ibar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBar, g_object_unref)
 static GType ibar_get_type_once (void);
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
index e277df4900e4ce9349058bc3db842cb9394ae339..d7941efef34d83ee29dbc9ac6db8d0097a099f7c 100644 (file)
@@ -105,9 +105,11 @@ static IBarIface * foo_ibar_parent_iface = NULL;
 static gpointer bar_parent_class = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gint ifoo_foo (IFoo* self);
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType ibar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBar, g_object_unref)
 VALA_EXTERN gchar* ibar_foo (IBar* self);
 static GType ibar_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
index 9cf5146542b882d74b7d6ccbea3ceb057448db3e..64ad86991c661bff2e80e90061ee415b11a24892 100644 (file)
@@ -110,9 +110,11 @@ VALA_EXTERN Base* base_new (void);
 VALA_EXTERN Base* base_construct (GType object_type);
 static GType base_get_type_once (void);
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gchar* ifoo_foo (IFoo* self);
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType ibar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBar, g_object_unref)
 VALA_EXTERN gint ibar_foo (IBar* self);
 static GType ibar_get_type_once (void);
 VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ;
index 9238e16672b9ad250475b6b4fed3fe24afad966f..970d4c629d52d4bdd93c4ff8444bc76e9d130d40 100644 (file)
@@ -122,6 +122,7 @@ static IFooIface * baz_ifoo_parent_iface = NULL;
 static IFazIface * baz_ifaz_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
index af4f79c49e0c82a5505b6185de6904c2dc3ab0aa..030238c8f4848eebd0ea427538d91a85b57d68c7 100644 (file)
@@ -76,6 +76,7 @@ VALA_EXTERN GMainLoop* loop;
 GMainLoop* loop = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN void ifoo_foo (IFoo* self,
                GAsyncReadyCallback _callback_,
                gpointer _user_data_);
index 1db37f74181ccb74f374941301842e238656a616..a2cf79f003b80c69334c4402f0eb6be5db4a2209 100644 (file)
@@ -77,6 +77,7 @@ static gpointer foo_parent_class = NULL;
 static IFooIface * foo_ifoo_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 static void ifoo_bar_data_free (gpointer _data);
 VALA_EXTERN void ifoo_bar (IFoo* self,
                gpointer g,
index bbff3c659f279e4cdb9411e69999afd1f3b4fa8f..097f5d5d9de8851bc8d3672be038995a9f07508b 100644 (file)
@@ -66,6 +66,7 @@ static gpointer foo_parent_class = NULL;
 static IFooIface * foo_ifoo_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gpointer ifoo_get (IFoo* self);
 static GType ifoo_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
index 02657c92dcf289fd47c99db3a636460b579f0379..83d996a082b53a733c700d3a222ffa03a96dbc34 100644 (file)
@@ -95,6 +95,7 @@ static gpointer bar_parent_class = NULL;
 static IFooIface * bar_ifoo_parent_iface = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gint ifoo_get_prop (IFoo* self);
 VALA_EXTERN void ifoo_set_prop (IFoo* self,
                     gint value);
index d380c2ad86b7b510c24401e00a9819a92be0adad..4ffe1f31a9d1b3e3676ac6320a2412d03f70d967 100644 (file)
@@ -130,6 +130,7 @@ VALA_EXTERN Foo* foo_construct (GType object_type);
 static void foo_finalize (Foo * obj);
 static GType foo_get_type_once (void);
 VALA_EXTERN GType ibar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBar, g_object_unref)
 VALA_EXTERN gint ibar_get_foo (IBar* self);
 VALA_EXTERN void ibar_set_foo (IBar* self,
                    gint value);
index 69868337cd87dfbce8f91e16f6bfd39a1663392b..25662b76bfd71617e1f975e2864fcfe35d124c77 100644 (file)
@@ -87,6 +87,7 @@ VALA_EXTERN GMainLoop* loop;
 GMainLoop* loop = NULL;
 
 VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
 VALA_EXTERN gint ifoo_foo (IFoo* self);
 static gint ifoo_real_foo (IFoo* self);
 static void ifoo_real_bar_data_free (gpointer _data);
index d328b8d184cc3c26576c5edaa8a78043f8b6f072..7581299bf89d541ff7aa2d81d96e3a7a1a7b9a9e 100644 (file)
@@ -86,6 +86,7 @@ static MamanIbazIface * maman_baz_maman_ibaz_parent_iface = NULL;
 static gpointer maman_sub_baz_parent_class = NULL;
 
 VALA_EXTERN GType maman_ibaz_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanIbaz, g_object_unref)
 VALA_EXTERN void maman_ibaz_do_action (MamanIbaz* self);
 VALA_EXTERN void maman_ibaz_do_virtual_action (MamanIbaz* self);
 VALA_EXTERN void maman_ibaz_protected_mixin_1 (MamanIbaz* self);
index 51af592e8c544ef014c5f9b9db4298a40ea87434..e656f2c33284252010a20471099f617904d2ac24 100644 (file)
@@ -403,6 +403,7 @@ VALA_EXTERN MamanDeepDerived* maman_deep_derived_new (void);
 VALA_EXTERN MamanDeepDerived* maman_deep_derived_construct (GType object_type);
 static GType maman_deep_derived_get_type_once (void);
 VALA_EXTERN GType maman_base_access_ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanBaseAccessIFoo, g_object_unref)
 VALA_EXTERN gint maman_base_access_ifoo_interface_method (MamanBaseAccessIFoo* self);
 VALA_EXTERN gint maman_base_access_ifoo_virtual_interface_method (MamanBaseAccessIFoo* self);
 static GType maman_base_access_ifoo_get_type_once (void);
index e4931d146dbf87066660a7c858d0cc5b4a15db4b..acecc6461ac64a6d7d77a72886ded3eb8ae0ca09 100644 (file)
@@ -388,6 +388,7 @@ static void sample_set_private_prop (Sample* self,
 static gint sample_main (void);
 VALA_EXTERN void maman_bar_run (void);
 VALA_EXTERN GType maman_ibaz_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanIbaz, g_object_unref)
 VALA_EXTERN MamanBaz* maman_baz_new (void);
 VALA_EXTERN MamanBaz* maman_baz_construct (GType object_type);
 VALA_EXTERN GType maman_baz_get_type (void) G_GNUC_CONST ;
@@ -471,6 +472,7 @@ static void _vala_maman_baz_get_property (GObject * object,
                                    GValue * value,
                                    GParamSpec * pspec);
 VALA_EXTERN GType maman_ibiz_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MamanIBiz, g_object_unref)
 VALA_EXTERN gint maman_ibiz_get_number (MamanIBiz* self);
 VALA_EXTERN void maman_ibiz_set_number (MamanIBiz* self,
                             gint value);
index ac3eb981e1ed977f7a8df790c4e122835bf0991d..63241b5eb9651b4a5d17441b5d63c6bdcd0bcb8b 100644 (file)
@@ -164,6 +164,7 @@ static void _vala_bar_get_property (GObject * object,
                              GValue * value,
                              GParamSpec * pspec);
 VALA_EXTERN GType ibaz_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBaz, g_object_unref)
 VALA_EXTERN gint ibaz_get_read_only (IBaz* self);
 static GType ibaz_get_type_once (void);
 VALA_EXTERN GType baz_get_type (void) G_GNUC_CONST ;
index 290075d8fe388abfba8158f3ffc64e82631914a6..0310e665e6305ffee12a317331441e927fb44d51 100644 (file)
@@ -137,6 +137,7 @@ VALA_EXTERN Maman* maman_construct (GType object_type);
 static void maman_finalize (Maman * obj);
 static GType maman_get_type_once (void);
 VALA_EXTERN GType ibar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBar, maman_unref)
 static GType ibar_get_type_once (void);
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, maman_unref)
index a056b3f018d60d47805fb8b42a3f91fd4d4aa385..38716fe12643ab0d91c415be0a6c450515eb5963 100644 (file)
@@ -66,6 +66,7 @@ static gpointer foo_parent_class = NULL;
 static IBarIface * foo_ibar_parent_iface = NULL;
 
 VALA_EXTERN GType ibar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (IBar, g_object_unref)
 static GType ibar_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
index d8b2495c0415c87e5fa8067ee77fb00a0ea478db..e1f0770edabf930590ff8912788c517f1243d827 100644 (file)
@@ -88,6 +88,7 @@ static gpointer manam_parent_class = NULL;
 static FooIface * manam_foo_parent_iface = NULL;
 
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)
 VALA_EXTERN gint foo_get_foo (Foo* self);
 static GType foo_get_type_once (void);
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
index 3b471d8e228cb04ea6ed547f3e9f66011960b19b..f0daa48ca1e10afaf806bc0d47123e79f483fd11 100644 (file)
@@ -196,10 +196,12 @@ VALA_EXTERN BazFooBar1* baz_foo_bar1_construct (GType object_type);
 static void baz_foo_bar1_finalize (BazFooBar1 * obj);
 static GType baz_foo_bar1_get_type_once (void);
 VALA_EXTERN GType baz_foo_ibar1_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (BazFooIBar1, baz_foo_bar1_unref)
 static GType baz_foo_ibar1_get_type_once (void);
 static void baz_foo_finalize (BazFoo * obj);
 static GType baz_foo_get_type_once (void);
 VALA_EXTERN GType baz_ifoo_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (BazIFoo, baz_foo_unref)
 VALA_EXTERN gpointer baz_ifoo_bar2_ref (gpointer instance);
 VALA_EXTERN void baz_ifoo_bar2_unref (gpointer instance);
 VALA_EXTERN GParamSpec* baz_ifoo_param_spec_bar2 (const gchar* name,
@@ -219,6 +221,7 @@ VALA_EXTERN BazIFooBar2* baz_ifoo_bar2_construct (GType object_type);
 static void baz_ifoo_bar2_finalize (BazIFooBar2 * obj);
 static GType baz_ifoo_bar2_get_type_once (void);
 VALA_EXTERN GType baz_ifoo_ibar2_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (BazIFooIBar2, baz_ifoo_bar2_unref)
 static GType baz_ifoo_ibar2_get_type_once (void);
 static GType baz_ifoo_get_type_once (void);
 VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ;
index 5ddc58ed04e30b6fb4711d3373e1b7edca434d64..e3bb9d6fc2bbb19edc722768c8316bb8686f4202 100644 (file)
@@ -34,6 +34,7 @@ struct _BarIface {
 };
 
 VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
 VALA_EXTERN Foo bar_bar (Bar* self);
 static GType bar_get_type_once (void);
 static void _vala_main (void);
index 0caf6e9169a2b4b4bb4851bc5cc8537fcc620f0d..8a54bd9f75ab7f9babf604a9c9b92f91a3ac6bee 100644 (file)
@@ -129,6 +129,7 @@ VALA_EXTERN Bar* bar_construct (GType object_type);
 static void bar_finalize (Bar * obj);
 static GType bar_get_type_once (void);
 VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (Manam, g_object_unref)
 static GType manam_get_type_once (void);
 VALA_EXTERN GType foo_get_type (void) G_GNUC_CONST ;
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Foo, g_object_unref)