Free template root accounts on book end

The template root should be unset so that it's destroyed when the book is
ending. This is required to free all the template accounts and referenced
strings.

The scheduled transactions themselves need to be freed first so reverse
the order that SXRegister and gnc_sxtt_register are called in
cashobjects_register: The list resulting from that function is traversed
from the bottom up.
This commit is contained in:
Simon Arlott 2021-07-11 15:58:34 +01:00 committed by John Ralls
parent 0061e21c4f
commit 4a8acf3fb2
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ sxtg_book_begin (QofBook *book)
static void
sxtg_book_end (QofBook *book)
{
// gnc_book_set_template_root (book, NULL);
gnc_book_set_template_root (book, NULL);
}
static gboolean

View File

@ -73,8 +73,8 @@ cashobjects_register(void)
g_return_val_if_fail(xaccAccountRegister(), FALSE);
g_return_val_if_fail ( xaccTransRegister(), FALSE);
g_return_val_if_fail ( xaccSplitRegister(), FALSE);
g_return_val_if_fail ( SXRegister (), FALSE);
g_return_val_if_fail ( gnc_sxtt_register(), FALSE);
g_return_val_if_fail ( SXRegister (), FALSE);
g_return_val_if_fail(gnc_pricedb_register(), FALSE);
g_return_val_if_fail (gnc_budget_register(), FALSE);
g_return_val_if_fail ( gnc_lot_register (), FALSE);