From: Luca Bruno Date: Sun, 26 Jun 2011 17:30:05 +0000 (+0200) Subject: codegen: Do not free captured parameters in return statements X-Git-Tag: 0.13.1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdf8d6fb9fd8b9fdaca60f0b8db2f9ac9837bd8a;p=thirdparty%2Fvala.git codegen: Do not free captured parameters in return statements Fixes bug 653391. --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 9f4a13a0b..65010e107 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -3136,7 +3136,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { private void append_param_free (Method m) { foreach (Parameter param in m.get_parameters ()) { - if (!param.ellipsis && requires_destroy (param.variable_type) && param.direction == ParameterDirection.IN) { + if (!param.captured && !param.ellipsis && requires_destroy (param.variable_type) && param.direction == ParameterDirection.IN) { ccode.add_expression (destroy_parameter (param)); } }