mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 798535 - Crash when increasing the number of periods in a budget
because in the SQL backend, gnc_budget_commit_edit will update the sql by reading from vectors with an increased priv->num_periods.
This commit is contained in:
parent
29f2c7c399
commit
670902d5a8
@ -476,15 +476,14 @@ gnc_budget_set_num_periods(GncBudget* budget, guint num_periods)
|
|||||||
|
|
||||||
gnc_budget_begin_edit(budget);
|
gnc_budget_begin_edit(budget);
|
||||||
priv->num_periods = num_periods;
|
priv->num_periods = num_periods;
|
||||||
qof_instance_set_dirty(&budget->inst);
|
|
||||||
gnc_budget_commit_edit(budget);
|
|
||||||
|
|
||||||
std::for_each (priv->acct_map->begin(),
|
std::for_each (priv->acct_map->begin(),
|
||||||
priv->acct_map->end(),
|
priv->acct_map->end(),
|
||||||
[num_periods](auto& it)
|
[num_periods](auto& it)
|
||||||
{
|
{
|
||||||
it.second.resize(num_periods);
|
it.second.resize(num_periods);
|
||||||
});
|
});
|
||||||
|
qof_instance_set_dirty(&budget->inst);
|
||||||
|
gnc_budget_commit_edit(budget);
|
||||||
|
|
||||||
qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
|
qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user