From: Jürg Billeter Date: Wed, 27 Apr 2011 10:51:34 +0000 (+0200) Subject: codegen: Fix memory leak for return statements in inner blocks X-Git-Tag: 0.12.1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77d187696c3f6cde71eb21d215d5619323b1b284;p=thirdparty%2Fvala.git codegen: Fix memory leak for return statements in inner blocks variable_accessible_in_finally was not correctly working as symbol lookup failed due to local.active set to false by visit_member_access. --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 764815cc6..c466ef9b4 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -3356,10 +3356,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { if (stmt.return_expression != null) { // avoid unnecessary ref/unref pair var local = stmt.return_expression.symbol_reference as LocalVariable; - if (current_return_type.value_owned - && local != null && local.variable_type.value_owned - && !local.captured - && !variable_accessible_in_finally (local)) { + if (local != null && !local.active) { /* return expression is local variable taking ownership and * current method is transferring ownership */