[vala/0.12] codegen: Fix memory leak for return statements in inner blocks
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.12] codegen: Fix memory leak for return statements in inner blocks
- Date: Sun, 29 May 2011 11:19:57 +0000 (UTC)
commit 77d187696c3f6cde71eb21d215d5619323b1b284
Author: Jürg Billeter <j bitron ch>
Date: Wed Apr 27 12:51:34 2011 +0200
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.
codegen/valaccodebasemodule.vala | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 764815c..c466ef9 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]