[vala] codegen: Do not free captured parameters in return statements



commit bdf8d6fb9fd8b9fdaca60f0b8db2f9ac9837bd8a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jun 26 19:30:05 2011 +0200

    codegen: Do not free captured parameters in return statements
    
    Fixes bug 653391.

 codegen/valaccodebasemodule.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 9f4a13a..65010e1 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));
 			}
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]