gnucash maint: [reports] use gnc:make-split->owner with guardian

Christopher Lam clam at code.gnucash.org
Mon Feb 13 10:18:17 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/4953cf94 (commit)
	from  https://github.com/Gnucash/gnucash/commit/2b32382c (commit)



commit 4953cf94fa95e904b0e484f01193f1af86dff2da
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Feb 13 23:04:26 2023 +0800

    [reports] use gnc:make-split->owner with guardian
    
    Instead of a gnc:split->owner, use gnc:make-split->owner instead which
    generates a split->owner function with its own hashtable. This
    function (and its hash table) will be garbage collected in due course,
    triggering the gncOwnerFreeing of all owners.
    
    This is a better approach than gnc:split->owner which maintains a
    single hash table. It could be buggy: a report calls gnc:split->owner
    to query a split, fails to reset its hashtable via #f; the split's
    owner is assigned or modified, and the next call to gnc:split->owner
    will return the incorrect cached owner.



Summary of changes:
 bindings/guile/business-core.scm                   | 35 +++++++++++++++++++++-
 gnucash/report/reports/standard/new-aging.scm      | 21 ++++++-------
 .../report/reports/standard/new-owner-report.scm   | 12 ++++----
 3 files changed, 48 insertions(+), 20 deletions(-)



More information about the gnucash-patches mailing list