GNOME Bugzilla – Bug 630184
arrays in [SImpleType] vapi override has_destroy_function
Last modified: 2010-10-16 18:02:12 UTC
I had a C struct like this: struct Foo { int data[4]; }; The straightforward vapi was -------- bug-vapi.vapi --------- [SimpleType] [CCode(has_copy_function = false, has_destroy_function = false)] struct Foo { public int data[4]; public Foo(); } -------------------------------- and it was used simply: ----------- bug.vala ----------- void main() { var foo = Foo(); } -------------------------------- Worked in 0.8, but in 0.10 ... $ valac --vapidir . --pkg bug-vapi bug.vala -C $ cat bug.c ... static void foo_destroy (Foo* self) { } void _vala_main (void) { Foo foo; foo = foo_init (); foo_destroy (foo); } ... This doesn't compile (foo_destroy needs a pointer). Anyway, I'm labeling this as a minor bug because it seems the correct way was public int *data;
commit df908b94f02bfd8f4c0e062dcc9d8da389ede175 Author: Jürg Billeter <j@bitron.ch> Date: Sat Oct 16 19:59:18 2010 +0200 Do not consider fixed-length arrays as disposable Fixes bug 630184.