From 0189f4b0e62edefa2b93f9bd4991a0c15c6cc3d5 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Sat, 11 Oct 2014 13:00:36 -0400 Subject: Some defensive programming at destruction time, and fix a latent dangling pointer bug. --- src/smt/smt_engine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/smt') 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 -- cgit v1.2.3