summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-06-06 01:16:31 -0700
committerAndres Noetzli <andres.noetzli@gmail.com>2020-06-06 01:21:22 -0700
commit74fdb2e4daee739bb6351b3d5005d011641def1d (patch)
treee55ad05ae1b2f99eda276b5647c4059fcda83bfa /src/expr
parent6a61c1a75b08867c7c06623b8c03084056b6bed7 (diff)
Fix destruction order in NodeManager
Fixes #4576. ASan was reporting memory leaks because the skolem manager was being destroyed after the attributes and zombies were already cleaned up in the destructor of NodeManager. This commit changes the destruction order to ensure that the skolem manager is destroyed before the rest of the cleanup. Note: this issue did not only make the benchmark in #4576 fail but several tests in our regressions.
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/node_manager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp
index 6f8934645..b32c93313 100644
--- a/src/expr/node_manager.cpp
+++ b/src/expr/node_manager.cpp
@@ -171,6 +171,9 @@ NodeManager::~NodeManager() {
NodeManagerScope nms(this);
+ // Destroy skolem manager before cleaning up attributes and zombies
+ d_skManager = nullptr;
+
{
ScopedBool dontGC(d_inReclaimZombies);
// hopefully by this point all SmtEngines have been deleted
@@ -233,7 +236,6 @@ NodeManager::~NodeManager() {
// defensive coding, in case destruction-order issues pop up (they often do)
delete d_resourceManager;
d_resourceManager = NULL;
- d_skManager = nullptr;
delete d_statisticsRegistry;
d_statisticsRegistry = NULL;
delete d_registrations;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback