[vala] girwriter: Fix handling of delegate params



commit d8c6c9505f5bc17a68c73f4f2e5fa58c6e07f7ec
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jul 17 15:10:53 2013 +0200

    girwriter: Fix handling of delegate params
    
    Regression of d74c5fb0654ef5985d763a7847c8013de781aac3

 codegen/valagirwriter.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 01e94db..8356afa 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -816,7 +816,8 @@ public class Vala.GIRWriter : CodeVisitor {
                } 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);
-                       if (type.value_owned) {
+                       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);
                        }
@@ -828,7 +829,8 @@ public class Vala.GIRWriter : CodeVisitor {
                        index++;
                } else if (type is DelegateType) {
                        index++;
-                       if (type.value_owned) {
+                       var deleg_type = (DelegateType) type;
+                       if (deleg_type.is_disposable ()) {
                                index++;
                        }
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]