From e0ab9aea1477d7a14f823a5b8f5f7e8c017aebea Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Mon, 2 Sep 2019 09:40:40 +0200 Subject: [PATCH] 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. --- vala/valagirparser.vala | 3 +++ vapigen/valagidlparser.vala | 3 +++ 2 files changed, 6 insertions(+) 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) { -- 2.47.2