Skip to content

Commit

Permalink
[gncJob] g_value_unset
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Jun 4, 2021
1 parent 1824a30 commit 36901c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libgnucash/engine/gncJob.c
Expand Up @@ -317,6 +317,7 @@ void gncJobSetRate (GncJob *job, gnc_numeric rate)
g_value_init (&v, GNC_TYPE_NUMERIC);
g_value_set_boxed (&v, &rate);
qof_instance_set_kvp (QOF_INSTANCE (job), &v, 1, GNC_JOB_RATE);
g_value_unset (&v);
}
else
{
Expand Down Expand Up @@ -453,13 +454,14 @@ gnc_numeric gncJobGetRate (const GncJob *job)
{
GValue v = G_VALUE_INIT;
gnc_numeric *rate = NULL;
gnc_numeric retval;
if (!job) return gnc_numeric_zero ();
qof_instance_get_kvp (QOF_INSTANCE (job), &v, 1, GNC_JOB_RATE);
if (G_VALUE_HOLDS_BOXED (&v))
rate = (gnc_numeric*)g_value_get_boxed (&v);
if (rate)
return *rate;
return gnc_numeric_zero();
retval = rate ? *rate : gnc_numeric_zero ();
g_value_unset (&v);
return retval;
}

GncOwner * gncJobGetOwner (GncJob *job)
Expand Down

0 comments on commit 36901c5

Please sign in to comment.