]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser/gidlparser: "value_owned = true" by default for property types e0ab9aea1477d7a14f823a5b8f5f7e8c017aebea
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 2 Sep 2019 07:40:40 +0000 (09:40 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 2 Sep 2019 08:27:27 +0000 (10:27 +0200)
This represents an internal implementation detail which is available from
vala sources and it does not effect the ownership of property accessors.

vala/valagirparser.vala
vapigen/valagidlparser.vala

index 57931ee501decabb5c2b3311364da3c5b749ac05..36d249c90458a0685530c29166eab8a343f820be 100644 (file)
@@ -996,6 +996,9 @@ public class Vala.GirParser : CodeVisitor {
                                                prop.set_accessor = new PropertyAccessor (false, (construct_only != "1") && (writable == "1"), (construct_only == "1") || (construct_ == "1"), prop.property_type.copy (), null, null);
                                        }
 
+                                       // there is no information about the internal ownership so assume `owned` as default
+                                       prop.property_type.value_owned = true;
+
                                        // find virtual/abstract accessors to handle abstract properties properly
 
                                        Node getter = null;
index 1d07cc63afc527a5a165d751b1041a67fb2b8e9a..5f956dbf8e1ae507e20f337270c6383da47f3220 100644 (file)
@@ -2739,6 +2739,9 @@ public class Vala.GIdlParser : CodeVisitor {
                        }
                }
 
+               // there is no information about the internal ownership so assume `owned` as default
+               prop.property_type.value_owned = true;
+
                var attributes = get_attributes ("%s:%s".printf (get_cname (current_data_type), node.name));
                if (attributes != null) {
                        foreach (string attr in attributes) {