[vala] Fix implicit GValue conversion from owned values
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Fix implicit GValue conversion from owned values
- Date: Sun, 21 Mar 2010 19:03:36 +0000 (UTC)
commit 46e22cd13bfab93ab50ac02d2636e3b8712ce0c5
Author: Jürg Billeter <j bitron ch>
Date: Sun Mar 21 20:02:25 2010 +0100
Fix implicit GValue conversion from owned values
codegen/valaccodebasemodule.vala | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index d25ba87..a6f2701 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4860,7 +4860,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
&& expression_type.get_type_id () != "G_TYPE_VALUE");
if (expression_type.value_owned
- && (target_type == null || !target_type.value_owned || boxing || unboxing || gvalue_boxing)) {
+ && (target_type == null || !target_type.value_owned || boxing || unboxing)) {
// value leaked, destroy it
var pointer_type = target_type as PointerType;
if (pointer_type != null && !(pointer_type.base_type is VoidType)) {
@@ -4930,7 +4930,11 @@ internal class Vala.CCodeBaseModule : CCodeModule {
ccall.add_argument (new CCodeIdentifier (expression_type.get_type_id ()));
ccomma.append_expression (ccall);
- ccall = new CCodeFunctionCall (get_value_setter_function (expression_type));
+ if (expression_type.value_owned) {
+ ccall = new CCodeFunctionCall (get_value_taker_function (expression_type));
+ } else {
+ ccall = new CCodeFunctionCall (get_value_setter_function (expression_type));
+ }
if (target_type.nullable) {
ccall.add_argument (get_variable_cexpression (decl.name));
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]