From: Rico Tzschichholz Date: Mon, 2 Sep 2019 07:40:40 +0000 (+0200) Subject: girparser/gidlparser: "value_owned = true" by default for property types X-Git-Tag: 0.46.0~15 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fkeep-around%2Fe0ab9aea1477d7a14f823a5b8f5f7e8c017aebea;p=thirdparty%2Fvala.git girparser/gidlparser: "value_owned = true" by default for property types This represents an internal implementation detail which is available from vala sources and it does not effect the ownership of property accessors. --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 57931ee50..36d249c90 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -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; diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 1d07cc63a..5f956dbf8 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -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) {