]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gidlparser: Support returns_floating_reference metadata
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 8 Jul 2016 13:41:49 +0000 (15:41 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 8 Jul 2016 13:41:49 +0000 (15:41 +0200)
vapigen/valagidlparser.vala

index 563eabee2ff155b13cb2fdae07edd9b9f0806db0..f23301903dc18b657761a265a031ebcb7c8387ba 100644 (file)
@@ -2272,6 +2272,11 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                m.set_attribute ("DestroysInstance", true, m.source_reference);
                                        }
+                               } else if (nv[0] == "returns_floating_reference") {
+                                       if (eval (nv[1]) == "1") {
+                                               m.set_attribute_bool ("CCode", "returns_floating_reference", true);
+                                               m.return_type.value_owned = true;
+                                       }
                                } else if (nv[0] == "nullable") {
                                        if (eval (nv[1]) == "1" && !(return_type is VoidType)) {
                                                return_type.nullable = true;