]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girwriter: Fix closure attribute for delegate targets 8b6b3a70498dddafa4b97d7d1bc7e6d451779441
authorAbderrahim Kitouni <a.kitouni@gmail.com>
Sat, 15 May 2010 17:25:21 +0000 (18:25 +0100)
committerJürg Billeter <j@bitron.ch>
Tue, 29 Jun 2010 17:46:18 +0000 (19:46 +0200)
The code was assuming that data_type would be a Delegate for a
DelegateType while it is null.

codegen/valagirwriter.vala

index be1daa4d4b64e12bda7b3ca7071e9d746edbb0bb..0c95b16a38c182cb3d85fd9eb47dc148bec0b6a1 100644 (file)
@@ -795,7 +795,7 @@ public class Vala.GIRWriter : CodeVisitor {
                        buffer.append_printf (" direction=\"out\"");
                }
 
-               Delegate delegate_type = type.data_type as Delegate;
+               DelegateType delegate_type = type as DelegateType;
 
                if ((type.value_owned && delegate_type == null) || constructor) {
                        buffer.append_printf (" transfer-ownership=\"full\"");
@@ -806,7 +806,7 @@ public class Vala.GIRWriter : CodeVisitor {
                        buffer.append_printf (" allow-none=\"1\"");
                }
 
-               if (delegate_type != null && delegate_type.has_target) {
+               if (delegate_type != null && delegate_type.delegate_symbol.has_target) {
                        buffer.append_printf (" closure=\"%i\"", index + 1);
                        if (type.value_owned) {
                                buffer.append_printf (" destroy=\"%i\"", index + 2);