diff options
author | Morgan Deters <mdeters@cs.nyu.edu> | 2014-10-11 13:00:36 -0400 |
---|---|---|
committer | Morgan Deters <mdeters@cs.nyu.edu> | 2014-10-11 13:00:36 -0400 |
commit | 0189f4b0e62edefa2b93f9bd4991a0c15c6cc3d5 (patch) | |
tree | bfc3068f94b08816167ee396e77c3369ddc8953d /src/smt | |
parent | 5527b0c00639f24b11d5e1d4c69050d908b82400 (diff) |
Some defensive programming at destruction time, and fix a latent dangling pointer bug.
Diffstat (limited to 'src/smt')
-rw-r--r-- | src/smt/smt_engine.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 2a12b07de..dcfc526ec 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -809,6 +809,7 @@ SmtEngine::~SmtEngine() throw() { for(unsigned i = 0; i < d_dumpCommands.size(); ++i) { delete d_dumpCommands[i]; + d_dumpCommands[i] = NULL; } d_dumpCommands.clear(); @@ -819,15 +820,22 @@ SmtEngine::~SmtEngine() throw() { d_definedFunctions->deleteSelf(); delete d_theoryEngine; + d_theoryEngine = NULL; delete d_propEngine; + d_propEngine = NULL; delete d_decisionEngine; + d_decisionEngine = NULL; delete d_stats; + d_stats = NULL; delete d_statisticsRegistry; + d_statisticsRegistry = NULL; delete d_private; + d_private = NULL; delete d_userContext; + d_userContext = NULL; } catch(Exception& e) { Warning() << "CVC4 threw an exception during cleanup." << endl |