]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Fix callback parameters with destroy_notify
authorJürg Billeter <j@bitron.ch>
Tue, 29 Jun 2010 19:08:07 +0000 (21:08 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 29 Jun 2010 19:22:50 +0000 (21:22 +0200)
vala/valagirparser.vala

index 4d051a320cf231c2482c7d90944d10ad509f5bdd..51778999087c7853d703c1e902c9acf95c12e2a1 100644 (file)
@@ -400,7 +400,7 @@ public class Vala.GirParser : CodeVisitor {
                        end_element ("varargs");
                } else {
                        var type = parse_type (null, out array_length_idx, transfer == "full");
-                       if (transfer == "full" || transfer == "container") {
+                       if (transfer == "full" || transfer == "container" || destroy != null) {
                                type.value_owned = true;
                        }
                        if (allow_none == "1") {
@@ -1005,15 +1005,13 @@ public class Vala.GirParser : CodeVisitor {
                                        }
                                        info.param.cdelegate_target_parameter_position = parameters[info.closure_idx - add].vala_idx;
                                }
-/* Leaving this as a TODO, needs more testing
                                if (info.destroy_idx != -1) {
                                        if (info.destroy_idx - add >= parameters.size) {
                                                Report.error (get_current_src (), "invalid destroy index");
                                                continue;
                                        }
-                                       info.param.cdelegate_target_parameter_position = parameters[info.destroy_idx - add].vala_idx;
+                                       info.param.cdestroy_notify_parameter_position = parameters[info.destroy_idx - add].vala_idx;
                                }
-*/
                        }
                }