]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix delegate variables in GObject creation methods
authorJürg Billeter <j@bitron.ch>
Mon, 28 Sep 2009 16:01:46 +0000 (18:01 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 28 Sep 2009 16:01:46 +0000 (18:01 +0200)
Fixes bug 596621.

codegen/valaccodemethodmodule.vala
tests/Makefile.am
tests/objects/bug596621.vala [new file with mode: 0644]

index aa2c1fe4b30224a416b1dcdffc244546c8b3b75d..93d49ab5dcddbb4ef16b200e2dab01c41c4b8a56 100644 (file)
@@ -311,6 +311,7 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
                                                if (!local.floating && requires_destroy (local.variable_type)) {
                                                        var ma = new MemberAccess.simple (local.name);
                                                        ma.symbol_reference = local;
+                                                       ma.value_type = local.variable_type.copy ();
                                                        cblock.add_statement (new CCodeExpressionStatement (get_unref_expression (get_variable_cexpression (local.name), local.variable_type, ma)));
                                                }
                                        }
index 8c83e86f78986a96ccd140b5d20bca6b27736954..f1058b826ea93bb5409987a887a85d3bd0f42fe6 100644 (file)
@@ -48,6 +48,7 @@ TESTS = \
        objects/test-029.vala \
        objects/test-034.vala \
        objects/bug593260.vala \
+       objects/bug596621.vala \
        errors/errors.vala \
        errors/bug596228.vala \
        asynchronous/bug595735.vala \
diff --git a/tests/objects/bug596621.vala b/tests/objects/bug596621.vala
new file mode 100644 (file)
index 0000000..348ea40
--- /dev/null
@@ -0,0 +1,15 @@
+class Foo : Object {
+       [CCode (has_construct_function = false)]
+       public Foo () {
+       }
+}
+
+class Bar : Foo {
+       public Bar () {
+               Func baz;
+       }
+}
+
+void main () {
+}
+