]> 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, 26 Mar 2018 09:02:48 +0000 (11:02 +0200)
codegen/valaccodebasemodule.vala

index 75f1c2add6c2b59fbbe83c04ce03500c0f0ece1b..0a8bf1f322dd332fdafbefd08ec213aceffbb271 100644 (file)
@@ -1955,7 +1955,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)));