]> 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, 24 Feb 2022 12:45:18 +0000 (13:45 +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 8b0619ad4890bffd46e1605f3c20cd605c175a49..c867d18f83f60f650bfc0722466e225125f98995 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 ba31c9f469650e562b5826fb353dc127a7552835..d92b9a8fe66380043d8a70728051245327372224 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 8eb5f5b137b8a88f92373e83be512ba223121958..baab03038385e2a6aea25550d1a103ceb9935e87 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 09097dfb5f3003693db0924d48449683f4e67017..a4337dce18cd1a61240d2d3ac3da0025d5c8329f 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 7f1f988c5ee8fff7cc420fcc7e0548a53937783c..2424afda6bc52c6e1c080ce4c280d9624b4dd5f6 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 b6bc4b0f998f546f41200be78a621b68ad24346e..b46f5548d3812088060f517f30f83908325ec24b 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 8ad54f27f063642dec7880f0fa3001c58d6e366d..dfac708c26aa1f3e3ab8ecd0d08923be10259812 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 fba78c3c8bd5981c6e2250935117316dcda6ab27..c76d0834d484f19fc1a06aae9009955523bfb1d6 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 9559269732d8d2664ef3b5f4223559b76ae0295f..5733445517275ad3cfba58bbf5bcfeaf09e0d55b 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 c69a9b3216cd63be030f67504d20ab2fa2157e12..995bc1dc3da177ac770aec6ec2fa9ae372a5ab87 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 343fff00a8fb8bd9146e4fe668a614640cdef329..c108a12b8bcd16281a1092d3336ca2c07ff020cd 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 e91779a44fc79589fdb5b79305df213e429eeb6e..71da10ef26f023e7af598a69b2de9288fc5c841b 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 8bb99cf85b7fa81d3393031178079ec2afa770c8..ec06c433ffe8df958c06937c9ebe95cb529a02d1 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 faabb245dc51d13da2350784e873f471d8b0eadf..dc44533a53ea92a9d9042106933728b8001a4d5e 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 7fcc4b7e15115f23af74c79724f906d7b96dae28..22512e652c8040c12a6f437207bdd8139fe2f96c 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 3c3aedfcdc0fec86fe6656fde0d3c77ebe34bb71..270f433d4316622d161635c302ce3677221b56b4 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 df47d4e3d01f974d772c783dd20099379811ffb8..a9aca9d154500f174888e54265dd5f65e40acea2 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 288d9a2cc966cedbb519083e0b00a1ee0e9bf9ac..ad172cced4f59a59d864c0fad21946768d3986c4 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 382bd9412888f2025d12d0a0ee5b2cc83b742c1b..ad7130d8fa2805f6b4f6fa05a78106950f3a10de 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 1cfde4f70679eff91bbb2492053fb864d890e0df..1e22e2c83d65aef0e64d9d11156e2d98eee76aa4 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 45bc09d0bcf13171caf6b28aa3fea4b23cd4ae46..2694775d2e6054138ef475fd752f1ec774d9b0a6 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 f7438c4b368ea13000d4489136625aaa589b5600..908ddc35c06c9f0b20904c480ef7e248771d24a4 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 9d6f2262a4336debf2b8380325e04079fae3fef3..b458ecf0236eff1fd6f5d458d7cdafcfa51f8ccf 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 9b1a49f78cdc3732b5e074f2929d804d4911e9f4..13e5b50bcc33731aa1f05bbfa5baa53c19c301c8 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 cba90e262b1a428e68a0a3febdb1ffccf5679104..1a3a8473af911e4ff940874a18f58c7c9760a8b2 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 70ffe3afd170ccce3661a7cee5e084649d872291..358753685b1a7dabe9ff71b4f136e3de05bda3af 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 cd56a52ebc311dcdab46f85e08b7d27fd92e4b6e..3822e2dc3db23a52e4bb2135fa8f3e180fd2e7bc 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 19b35084b0d375f91493e423b3a937414f459850..354f61cbb5a4abfd8bf0971a448cc4f687300897 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 7c595a05d47a118d145613e451ca15b1b8dde6f2..801109028e7ff8c99b4c427b7dabec35d7ae43a6 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 fa754b0550ce72053763ff2fc2a1509578615ac0..9442943e9f199bc618066fdd88eecf3e33fc6b85 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 1e4b031a9286536e4e28cb8fc7ef73c84f9e1752..e7930ca789288869a19e7923b0dda505c8f008ef 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 b570e9e26a604669dd38d20806c81eca7abc3f95..3eaecad79c84c61682f42e379f3fc5a7dfa5db46 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 0ed5f457a976ac4bc3ed4f8da0b738ab59b3f40d..06d31b398b22f6b2029ee0a76c3393833944ddb1 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 0c4e53568c42a1a3678741f706068488c130edca..71e1aa0164efc91524edbfd7c9eb825618e40024 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 4442c24e81a385aee96d9f4f21661b532100e9ab..3a8087f1aa5ea443aeddd5fe3a5c7cdd86619a72 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 b33b02fff48cc4c84c40bcddcedabe987d859b0f..4026eba9dd6b23e57b897b310330c7ca042c4af5 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 bcb6434356fd6af67b45e7f2ef6b276848326c44..871617da4c2ab288e92bd4194eb91cb5ad7a6a1e 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 9771371aa64e450b2fbf41f8a45a5d68fe9a5d64..8cc76765bd0d79880716e7e36aa8b275b85bb858 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 3d4ee34be9ce102139031d731e45a301aaeceaa0..92cf1c1e7b12beacf62477b30f543778c2e9888a 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 6f5e25d4562ce0b018e0effd79f281bc745c5d0e..9ce869b9c19228fbeaa810f3428e6af17a21e29c 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 fe13d474252c4b8adc6213597af185002c6edc91..01a87924443a3a6dcfcde561378bb959149dc473 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 1db51a203a957467fd0c72d5d0d12f9bb67f7116..53fcd2158891b1361dd30a4371d1756190dcca84 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 034158448fe4e7f30dc55fdb597df3c61bcf6c9b..6d9dec170eaa5deceb0286c04756a3d854ecdd92 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 7a633d3a260226169d007afd2e7411dd91983890..3008fbc0107c79633345b2caddcdd01f699790fb 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 3ff94e87b934f6da6f8c09a46dbe2e621a3ed9f1..a770c2b32deb9a507c3652bbf9f25f43870d8eb7 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 25068be12b5ced4c2616db811fbfa3c979ea679e..fce71f4e7ace44efd19af90f4efdf36063c0a18f 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 d59406b1f0aea9e83fc20e43aec4a12f6422385e..8119180765bd9bf2ba8a435254f4da8c9d83f9b5 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 fb36b0a84534d0db7f8c06ed5b0537554958a29e..494585889f4afe828f2092d2e67edcec6b9314ca 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 d0d0318ff614cbef2e65edf0966e9bfe35ba9c02..985de3f66c94a68edec77089659ce3d21f5c479d 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 e9e4491c20ea1b3353ce7eb5401bb0315ea15bd0..d6cd58a21ea399ec2de94a09c145cb49e51bd416 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 9589759d69dbca92224bf081bf984bdf27f1d35d..021cce6471e33e173b791d15199d59d27d12b60b 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 7059d89e7c96ff1b901b75125139cbdb56249edf..8e10b48d8073abb81a1fca7ca1ddf3f3dd57a2dc 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 46355cc975bea96861c425a0b52ff63d34d27772..5181438c15d6b46aba00a4346aef0e573cc1f545 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 7b5ed4f1f18a8ce25fa5839dfcff1f4dcfd00f7b..f5762fce1f25dc25f45a956f783a270e211d5496 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 ffba0e5f200c47342419fd65fc66ae9f5d6cf6c3..38321f5cb875ba68e6737bdec4949b6fa7d3e959 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 7e078561062b1a62b50241c24eef6402ee9cff0e..107e1bb3bffbcd157c1955de4e61cbe71f878394 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 18aca57a70664ed92b3ba8fab21bfa0dfb302b41..ad5ba37e7536cecc15eca85897311b125c879931 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 f8bc9c89ee474213ba69e098492eb05928ac91fe..0fee3f75fde6eee0ea1555a46e23b971eaa85679 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 5a4d8ba8f9b83b6f6b0e19a6cf2d6cb371929c42..a8cbb9597fe65c28aeb76c39aed6e3611a8071a5 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 c5ed4c7f881fd6b969a2158223372fdb85bf3d6f..ce85370f1aa39dabe3c4a6524fb2749c008c3d08 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 66fd9e76a8c154fa4eba8eb1b33e3e5fe977cc6d..11a862f44bab882ca0c8a14696c1d944d1235890 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 2bc1d446fa65206a4330ff7b26bd4472643a36fb..958f3df9eedd431309a4da7ba840ac5739b3a127 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 9d55b45a53a03de6ee0e2fc97c8c1e270e753a3d..695fcc1806598ffbfb0a0307a1f3d6a627f28812 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)