From 5b8ced2895439fd9612bc3bf2485056f41219d03 Mon Sep 17 00:00:00 2001 From: Tim King Date: Thu, 24 Mar 2016 10:54:00 -0700 Subject: [PATCH] Fix for a memory leak in InstStrategyCegqi. --- src/theory/quantifiers/inst_strategy_cbqi.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/theory/quantifiers/inst_strategy_cbqi.cpp b/src/theory/quantifiers/inst_strategy_cbqi.cpp index faad18c28..6ffd91334 100644 --- a/src/theory/quantifiers/inst_strategy_cbqi.cpp +++ b/src/theory/quantifiers/inst_strategy_cbqi.cpp @@ -35,7 +35,7 @@ using namespace CVC4::theory::arith; InstStrategyCbqi::InstStrategyCbqi( QuantifiersEngine * qe ) : QuantifiersModule( qe ), d_added_cbqi_lemma( qe->getUserContext() ) -//, d_added_inst( qe->getUserContext() ) +//, d_added_inst( qe->getUserContext() ) { } @@ -588,6 +588,13 @@ InstStrategyCegqi::InstStrategyCegqi( QuantifiersEngine * qe ) InstStrategyCegqi::~InstStrategyCegqi() throw () { delete d_out; + + for(std::map< Node, CegInstantiator * >::iterator i = d_cinst.begin(), + iend = d_cinst.end(); i != iend; ++i) { + CegInstantiator * instantiator = (*i).second; + delete instantiator; + } + d_cinst.clear(); } void InstStrategyCegqi::processResetInstantiationRound( Theory::Effort effort ) { -- 2.30.2