gnucash maint: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Thu Aug 5 14:50:47 EDT 2021
Updated via https://github.com/Gnucash/gnucash/commit/f0926d66 (commit)
via https://github.com/Gnucash/gnucash/commit/7a0ea190 (commit)
from https://github.com/Gnucash/gnucash/commit/86bc9d93 (commit)
commit f0926d66c1ed8cf24b1fbe60810eb03a14965922
Merge: 86bc9d93a 7a0ea190c
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 5 11:45:14 2021 -0700
Merge Simon Arlott's 'qof-instance-dispose' into maint.
commit 7a0ea190ca9e9b36a308960950418488324aa1f2
Author: Simon Arlott <sa.me.uk>
Date: Sun Jul 11 15:09:45 2021 +0100
qof_instance_dispose should always complete dispose processes
If QofInstancePrivate has no collection then qof_instance_dispose() returns
without completing the rest of its dispose processes, skipping removal of
its type string from the string cache resulting in a reference count leak.
Change the check for a collection so that it only affects the call to
qof_collection_remove_entity().
diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp
index 980e43bf9..7f99994a9 100644
--- a/libgnucash/engine/qofinstance.cpp
+++ b/libgnucash/engine/qofinstance.cpp
@@ -319,9 +319,8 @@ qof_instance_dispose (GObject *instp)
QofInstance* inst = QOF_INSTANCE(instp);
priv = GET_PRIVATE(instp);
- if (!priv->collection)
- return;
- qof_collection_remove_entity(inst);
+ if (priv->collection)
+ qof_collection_remove_entity(inst);
CACHE_REMOVE(inst->e_type);
inst->e_type = NULL;
Summary of changes:
libgnucash/engine/qofinstance.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
More information about the gnucash-changes
mailing list