Skip to content

Commit

Permalink
[qofinstance.cpp] GValue on stack instead of heap
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Oct 15, 2024
1 parent 635b213 commit e146210
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libgnucash/engine/qofinstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,17 +1340,16 @@ struct wrap_param
static void
wrap_gvalue_function (const char* key, KvpValue *val, wrap_param & param)
{
GValue *gv;
gv = g_slice_new0 (GValue);
GValue gv;
if (val->get_type() != KvpValue::Type::FRAME)
gvalue_from_kvp_value(val, gv);
gvalue_from_kvp_value(val, &gv);
else
{
g_value_init (gv, G_TYPE_STRING);
g_value_set_string (gv, nullptr);
g_value_init (&gv, G_TYPE_STRING);
g_value_set_string (&gv, nullptr);
}
param.proc(key, gv, param.user_data);
g_slice_free (GValue, gv);
param.proc(key, &gv, param.user_data);
g_value_unset (&gv);
}

void
Expand Down

0 comments on commit e146210

Please sign in to comment.