mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-26 08:00:05 -05: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:
1 parent
e54e9d8086
commit
7b46466ebd
1 file changed
+2
-2
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user