]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Use g_boxed_free in free-wrapper for heap-allocated GLib.Value
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 3 Feb 2021 12:40:23 +0000 (13:40 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 3 Feb 2021 12:40:23 +0000 (13:40 +0100)
dup-wrapper is specifically using g_boxed_copy already

codegen/valaccodebasemodule.vala

index cb45509428bf79056cbae2940666897ff85bc7c3..e4ab211fe931270d4d0eb8f92a1a20630a5ec109 100644 (file)
@@ -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"));