]> 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>
Thu, 3 Oct 2019 07:32:58 +0000 (09:32 +0200)
Don't unconditionally set delegate_target_destroy_notify_cvalue to NULL for any
variable access.

codegen/valaccodememberaccessmodule.vala

index 8e546878eceaa976c9bfe3fdbab8dd9e1052ad04..24e0cedf8d3298e82b41583dc87356670343cdcf 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;