]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix code generation for destroy_notify calls for delegate targets
authorAli Sabil <ali.sabil@gmail.com>
Sun, 11 Apr 2010 12:59:45 +0000 (14:59 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 21 Apr 2010 12:37:56 +0000 (14:37 +0200)
Fixes bug 615440.

codegen/valaccodebasemodule.vala

index 91b14e338e796623b714de77c96f10550b237950..d76aefcaa8a4b01a4324775055ce0e577f00604d 100644 (file)
@@ -2855,10 +2855,14 @@ internal class Vala.CCodeBaseModule : CCodeModule {
                        var ccall = new CCodeFunctionCall (delegate_target_destroy_notify);
                        ccall.add_argument (delegate_target);
 
+                       var destroy_call = new CCodeCommaExpression ();
+                       destroy_call.append_expression (ccall);
+                       destroy_call.append_expression (new CCodeConstant ("NULL"));
+
                        var cisnull = new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, delegate_target_destroy_notify, new CCodeConstant ("NULL"));
 
                        var ccomma = new CCodeCommaExpression ();
-                       ccomma.append_expression (new CCodeConditionalExpression (cisnull, new CCodeConstant ("NULL"), ccall));
+                       ccomma.append_expression (new CCodeConditionalExpression (cisnull, new CCodeConstant ("NULL"), destroy_call));
                        ccomma.append_expression (new CCodeAssignment (cvar, new CCodeConstant ("NULL")));
                        ccomma.append_expression (new CCodeAssignment (delegate_target, new CCodeConstant ("NULL")));
                        ccomma.append_expression (new CCodeAssignment (delegate_target_destroy_notify, new CCodeConstant ("NULL")));