]> 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, 19 Mar 2018 09:57:03 +0000 (10:57 +0100)
codegen/valaccodebasemodule.vala

index 44d88e41c95a12addc6956e9e92bf77fc54b8c7c..9f02b8c77894e30c65cddf0ac5050bf61637c4b0 100644 (file)
@@ -1989,7 +1989,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)));