mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Plug memory leak in xaccSplitDestroy
Splits were not marked for deletion if the transaction is read-only and the account is not marked for deletion yet. The net result is that split will not be freed later on. However xaccSplitDestroy is also called from a Transaction's do_destroy. At that point accounts are not necessarily marked for deletion yet (like is the case when a datafile is closed). This turned out to be a problem for invoice post transactions (which are also read only) and hence would cause memory to leak.
This commit is contained in:
parent
196decf649
commit
b866d7d955
@ -1447,6 +1447,7 @@ xaccSplitDestroy (Split *split)
|
||||
acc = split->acc;
|
||||
trans = split->parent;
|
||||
if (acc && !qof_instance_get_destroying(acc)
|
||||
&& !qof_instance_get_destroying(trans)
|
||||
&& xaccTransGetReadOnly(trans))
|
||||
return FALSE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user