]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Don't add target fields for captured delegates without target
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 19 Mar 2018 09:53:52 +0000 (10:53 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 16 Apr 2018 19:12:47 +0000 (21:12 +0200)
codegen/valaccodebasemodule.vala

index cbdafca308e50d5d3a89e45a173037a4fcb632c6..27f295bd4f39cbafd831d981c327e89c9bb41fb1 100644 (file)
@@ -1935,7 +1935,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                                        data.add_field ("gint", get_array_length_cname (get_local_cname (local), dim));
                                                }
                                                data.add_field ("gint", get_array_size_cname (get_local_cname (local)));
-                                       } else if (local.variable_type is DelegateType) {
+                                       } else if (local.variable_type is DelegateType && ((DelegateType) local.variable_type).delegate_symbol.has_target) {
                                                data.add_field ("gpointer", get_delegate_target_cname (get_local_cname (local)));
                                                if (local.variable_type.value_owned) {
                                                        data.add_field ("GDestroyNotify", get_delegate_target_destroy_notify_cname (get_local_cname (local)));