From 673888dee7c972d2ed8470ccc28c466162910a6d Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 9 Nov 2016 18:41:05 +0100 Subject: [PATCH] Remove lot from account while deleting the lot There was no way the account was informed about the lot being deleted. This was resulting into invalid lot lists in an account while scrubbing. Which would bomb at later stages like when re-running check & repair or opening the lot viewer. Also saving would report a number of critical messages about invalid objects, but these didn't result in a segfault. --- src/engine/gnc-lot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/gnc-lot.c b/src/engine/gnc-lot.c index ce780c48d1..3afb296f55 100644 --- a/src/engine/gnc-lot.c +++ b/src/engine/gnc-lot.c @@ -227,6 +227,9 @@ gnc_lot_free(GNCLot* lot) } g_list_free (priv->splits); + if (priv->account) + xaccAccountRemoveLot (priv->account, lot); + priv->account = NULL; priv->is_closed = TRUE; /* qof_instance_release (&lot->inst); */