]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gidlparser: Support transfer_container metadata for arrays
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 23 Nov 2015 13:38:24 +0000 (14:38 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 23 Nov 2015 13:38:24 +0000 (14:38 +0100)
vapigen/valagidlparser.vala

index f89885fe9230914bb41209ebf99f4d52dcdca1c8..9bced0b93699406fb423ad7046c81efb527ea13d 100644 (file)
@@ -2261,6 +2261,13 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                return_type.value_owned = true;
                                        }
+                               } else if (nv[0] == "transfer_container") {
+                                       if (eval (nv[1]) == "1") {
+                                               return_type.value_owned = true;
+                                               if (return_type is ArrayType) {
+                                                       ((ArrayType) return_type).element_type.value_owned = false;
+                                               }
+                                       }
                                } else if (nv[0] == "destroys_instance") {
                                        if (eval (nv[1]) == "1") {
                                                m.set_attribute ("DestroysInstance", true, m.source_reference);