[vala/0.10] codegen: Fix double free with GValue boxing
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.10] codegen: Fix double free with GValue boxing
- Date: Fri, 8 Oct 2010 21:18:21 +0000 (UTC)
commit 0dd38042823951e3bb095ad6de122c8f0e70847b
Author: Jürg Billeter <j bitron ch>
Date: Thu Oct 7 00:07:20 2010 +0200
codegen: Fix double free with GValue boxing
Fixes bug 631356.
codegen/valaccodebasemodule.vala | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 0be2745..e263e8f 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5166,7 +5166,8 @@ public class Vala.CCodeBaseModule : CodeGenerator {
&& expression_type.data_type != gvariant_type);
if (expression_type.value_owned
- && (target_type == null || !target_type.value_owned || boxing || unboxing)) {
+ && (target_type == null || !target_type.value_owned || boxing || unboxing)
+ && !gvalue_boxing /* gvalue can assume ownership of value, no need to free it */) {
// value leaked, destroy it
var pointer_type = target_type as PointerType;
if (pointer_type != null && !(pointer_type.base_type is VoidType)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]