]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Preserve full access to delegate variables and its target/destroy cvalues
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 2 Oct 2019 21:23:12 +0000 (23:23 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Oct 2019 11:45:55 +0000 (13:45 +0200)
Don't unconditionally set delegate_target_destroy_notify_cvalue to NULL for any
variable access.

codegen/valaccodememberaccessmodule.vala

index 5ef5f4eb93ec522b8c29aeccd5447b3319130220..1f72c1f0ebbb97b25c1eaf785ea6953b0dfe5157 100644 (file)
@@ -735,9 +735,9 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                } else if (delegate_type != null) {
                        if (!get_ccode_delegate_target (variable)) {
                                result.delegate_target_cvalue = new CCodeConstant ("NULL");
+                               result.delegate_target_destroy_notify_cvalue = new CCodeConstant ("NULL");
                        }
 
-                       result.delegate_target_destroy_notify_cvalue = new CCodeConstant ("NULL");
                        result.lvalue = false;
                }
                result.value_type.value_owned = false;