mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-25 02:10:36 -06:00
[gnc-budget] g_value_unset GValue
This commit is contained in:
parent
a6ecd30741
commit
3353d3950b
@ -562,6 +562,7 @@ gnc_budget_is_account_period_value_set(const GncBudget *budget,
|
||||
qof_instance_get_kvp (QOF_INSTANCE (budget), &v, 2, path_part_one, path_part_two);
|
||||
if (G_VALUE_HOLDS_BOXED (&v))
|
||||
ptr = g_value_get_boxed (&v);
|
||||
g_value_unset (&v);
|
||||
return (ptr != NULL);
|
||||
}
|
||||
|
||||
@ -571,6 +572,7 @@ gnc_budget_get_account_period_value(const GncBudget *budget,
|
||||
guint period_num)
|
||||
{
|
||||
gnc_numeric *numeric = NULL;
|
||||
gnc_numeric retval;
|
||||
gchar path_part_one [GUID_ENCODING_LENGTH + 1];
|
||||
gchar path_part_two [GNC_BUDGET_MAX_NUM_PERIODS_DIGITS];
|
||||
GValue v = G_VALUE_INIT;
|
||||
@ -583,9 +585,9 @@ gnc_budget_get_account_period_value(const GncBudget *budget,
|
||||
if (G_VALUE_HOLDS_BOXED (&v))
|
||||
numeric = (gnc_numeric*)g_value_get_boxed (&v);
|
||||
|
||||
if (numeric)
|
||||
return *numeric;
|
||||
return gnc_numeric_zero();
|
||||
retval = numeric ? *numeric : gnc_numeric_zero ();
|
||||
g_value_unset (&v);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user