[vala/staging] codegen: Don't add target fields for captured delegates without target



commit ce48e6decb377839fe6f2d275a684063ed672dc7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Mar 19 10:53:52 2018 +0100

    codegen: Don't add target fields for captured delegates without target

 codegen/valaccodebasemodule.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 44d88e4..9f02b8c 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -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)));


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