[vala] girparser: Do not unconditionally make a delegate owned
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] girparser: Do not unconditionally make a delegate owned
- Date: Sun, 31 Jan 2016 20:45:47 +0000 (UTC)
commit c2eecf463991304dfec6595afd2584c2efca8e0a
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Jan 31 21:39:26 2016 +0100
girparser: Do not unconditionally make a delegate owned
Actually check if there are closure and destroy arguments available.
vala/valagirparser.vala | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index a9c994a..e900c61 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3723,9 +3723,14 @@ public class Vala.GirParser : CodeVisitor {
var d = ((DelegateType) resolved_type).delegate_symbol;
if (!(d.name == "DestroyNotify" && d.parent_symbol.name == "GLib")) {
info.param.set_attribute_string ("CCode", "scope", "async");
- info.param.variable_type.value_owned = true;
+ info.param.variable_type.value_owned = (info.closure_idx !=
-1 && info.destroy_idx != -1);
}
}
+ } else {
+ var resolved_type = info.param.variable_type;
+ if (resolved_type is DelegateType) {
+ info.param.variable_type.value_owned = (info.closure_idx != -1 &&
info.destroy_idx != -1);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]