summaryrefslogtreecommitdiff
path: root/src/smt
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-04-26 10:52:15 -0700
committerTim King <taking@google.com>2016-04-26 10:52:15 -0700
commita9561238ac2ce5fc0bcd7f81368057181adf971e (patch)
tree0b9aa1b045c66dff033f2ade4fb5080f33f30c52 /src/smt
parentfe5693cac331c5eebe3da42406aa9217fb4787ff (diff)
Fixing a memory leak of the ProofManager.
Diffstat (limited to 'src/smt')
-rw-r--r--src/smt/smt_engine.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index 5bd1cbdfc..021798132 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -1061,12 +1061,16 @@ SmtEngine::SmtEngine(ExprManager* em) throw() :
// The ProofManager is constructed before any other proof objects such as
// SatProof and TheoryProofs. The TheoryProofEngine and the SatProof are
- // initialized in TheoryEngine and PropEngine respectively.
+ // initialized in TheoryEngine and PropEngine respectively.
Assert(d_proofManager == NULL);
+
+ // d_proofManager must be created before Options has been finished
+ // being parsed from the input file. Because of this, we cannot trust
+ // that options::proof() is set correctly yet.
#ifdef CVC4_PROOF
d_proofManager = new ProofManager();
#endif
-
+
// We have mutual dependency here, so we add the prop engine to the theory
// engine later (it is non-essential there)
d_theoryEngine = new TheoryEngine(d_context, d_userContext,
@@ -1100,7 +1104,7 @@ void SmtEngine::finishInit() {
Trace("smt-debug") << "SmtEngine::finishInit" << std::endl;
// ensure that our heuristics are properly set up
setDefaults();
-
+
Trace("smt-debug") << "Making decision engine..." << std::endl;
d_decisionEngine = new DecisionEngine(d_context, d_userContext);
@@ -1237,8 +1241,14 @@ SmtEngine::~SmtEngine() throw() {
delete d_decisionEngine;
d_decisionEngine = NULL;
- PROOF(delete d_proofManager;);
- PROOF(d_proofManager = NULL;);
+
+// d_proofManager is always created when proofs are enabled at configure time.
+// Becuase of this, this code should not be wrapped in PROOF() which
+// additionally checks flags such as options::proof().
+#ifdef CVC4_PROOF
+ delete d_proofManager;
+ d_proofManager = NULL;
+#endif
delete d_stats;
d_stats = NULL;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback