mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[account.cpp] fix regression caused by 3f7a5a8267
whereby deleting an account and moving all splits to another account would segfault. make a copy of priv->splits and work on the copy rather than the original.
This commit is contained in:
parent
e54e9d8086
commit
7b46466ebd
@ -2251,8 +2251,8 @@ xaccAccountMoveAllSplits (Account *accfrom, Account *accto)
|
||||
* Convert each split's amount to accto's commodity.
|
||||
* Commit to editing each transaction.
|
||||
*/
|
||||
std::for_each (from_priv->splits.begin(), from_priv->splits.end(),
|
||||
[accto](Split *s){ xaccPostSplitMove (s, accto); });
|
||||
auto splits = from_priv->splits;
|
||||
std::for_each (splits.begin(), splits.end(), [accto](auto s){ xaccPostSplitMove (s, accto); });
|
||||
|
||||
/* Finally empty accfrom. */
|
||||
g_assert(from_priv->splits.empty());
|
||||
|
Loading…
Reference in New Issue
Block a user