[vala] girwriter: Don't add target for delegates without target
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] girwriter: Don't add target for delegates without target
- Date: Sun, 2 Mar 2014 21:15:07 +0000 (UTC)
commit 978d0fa6ae0231ffdeb1cc8115ecb367992affbd
Author: Will Szumski <will cowboycoders org>
Date: Mon Feb 24 15:03:24 2014 +0000
girwriter: Don't add target for delegates without target
Fixes bug 725073.
codegen/valagirwriter.vala | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index f6da0ad..f3d5100 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -814,12 +814,14 @@ public class Vala.GIRWriter : CodeVisitor {
var int_type = new IntegerType (CodeContext.get ().root.scope.lookup ("int") as
Struct);
write_param_or_return (int_type, true, ref index, has_array_length,
"%s_length1".printf (name), null, direction);
} else if (type is DelegateType) {
- var data_type = new PointerType (new VoidType ());
- write_param_or_return (data_type, true, ref index, false, "%s_target".printf (name),
null, direction);
var deleg_type = (DelegateType) type;
- if (deleg_type.is_disposable ()) {
- var notify_type = new DelegateType (CodeContext.get ().root.scope.lookup
("GLib").scope.lookup ("DestroyNotify") as Delegate);
- write_param_or_return (notify_type, true, ref index, false,
"%s_target_destroy_notify".printf (name), null, direction);
+ if (deleg_type.delegate_symbol.has_target) {
+ var data_type = new PointerType (new VoidType ());
+ write_param_or_return (data_type, true, ref index, false, "%s_target".printf
(name), null, direction);
+ if (deleg_type.is_disposable ()) {
+ var notify_type = new DelegateType (CodeContext.get
().root.scope.lookup ("GLib").scope.lookup ("DestroyNotify") as Delegate);
+ write_param_or_return (notify_type, true, ref index, false,
"%s_target_destroy_notify".printf (name), null, direction);
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]