[vala/staging: 1/4] codegen: Use g_boxed_free in free-wrapper for heap-allocated GLib.Value




commit 619b96f5d8936dc1511bd1cf5197b3eb1050fd9f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Feb 3 13:40:23 2021 +0100

    codegen: Use g_boxed_free in free-wrapper for heap-allocated GLib.Value
    
    dup-wrapper is specifically using g_boxed_copy already

 codegen/valaccodebasemodule.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index cb4550942..e4ab211fe 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3313,7 +3313,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                push_function (function);
 
-               if (get_ccode_is_gboxed (type.type_symbol)) {
+               if (get_ccode_is_gboxed (type.type_symbol) || (gvalue_type != null && type.type_symbol == 
gvalue_type)) {
                        var free_call = new CCodeFunctionCall (new CCodeIdentifier ("g_boxed_free"));
                        free_call.add_argument (new CCodeIdentifier (get_ccode_type_id (type.type_symbol)));
                        free_call.add_argument (new CCodeIdentifier ("self"));


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