[vala] GAsync: Fix generating array dup/copy wrappers from async method
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] GAsync: Fix generating array dup/copy wrappers from async method
- Date: Wed, 16 Sep 2009 16:13:10 +0000 (UTC)
commit 26e1ee3b69e51787c66c332978f65b91c99f88bd
Author: Jürg Billeter <j bitron ch>
Date: Wed Sep 16 17:32:10 2009 +0200
GAsync: Fix generating array dup/copy wrappers from async method
codegen/valaccodearraymodule.vala | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index 1bc1f63..0dc1572 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -690,7 +690,9 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
var block = new CCodeBlock ();
if (requires_copy (array_type.element_type)) {
+ var old_symbol = current_symbol;
var old_temp_vars = temp_vars;
+ current_symbol = null;
var cdecl = new CCodeDeclaration (array_type.get_cname ());
var cvardecl = new CCodeVariableDeclarator ("result");
@@ -718,6 +720,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
var cfrag = new CCodeFragment ();
append_temp_decl (cfrag, temp_vars);
block.add_statement (cfrag);
+ current_symbol = old_symbol;
temp_vars = old_temp_vars;
} else {
var dup_call = new CCodeFunctionCall (new CCodeIdentifier ("g_memdup"));
@@ -761,7 +764,9 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
var block = new CCodeBlock ();
if (requires_copy (array_type.element_type)) {
+ var old_symbol = current_symbol;
var old_temp_vars = temp_vars;
+ current_symbol = null;
var idx_decl = new CCodeDeclaration ("int");
idx_decl.add_declarator (new CCodeVariableDeclarator ("i"));
@@ -778,6 +783,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
var cfrag = new CCodeFragment ();
append_temp_decl (cfrag, temp_vars);
block.add_statement (cfrag);
+ current_symbol = old_symbol;
temp_vars = old_temp_vars;
} else {
source_declarations.add_include ("string.h");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]