mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix leak of trading_splits list in xaccTransClearTradingSplits
This commit is contained in:
@@ -612,7 +612,7 @@ gnc_transaction_get_commodity_imbalance (Transaction *trans,
|
||||
|
||||
/* GFunc wrapper for xaccSplitDestroy */
|
||||
static void
|
||||
destroy_split (void* ptr, void* data)
|
||||
destroy_split (void* ptr)
|
||||
{
|
||||
Split *split = GNC_SPLIT (ptr);
|
||||
if (split)
|
||||
@@ -642,7 +642,10 @@ xaccTransClearTradingSplits (Transaction *trans)
|
||||
return;
|
||||
|
||||
xaccTransBeginEdit (trans);
|
||||
g_list_foreach (trading_splits, destroy_split, NULL);
|
||||
/* destroy_splits doesn't actually free the splits but this gets
|
||||
* the list ifself freed.
|
||||
*/
|
||||
g_list_free_full (trading_splits, destroy_split);
|
||||
xaccTransCommitEdit (trans);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user