From: Tim King Date: Thu, 24 Mar 2016 17:54:00 +0000 (-0700) Subject: Fix for a memory leak in InstStrategyCegqi. X-Git-Tag: cvc5-1.0.0~6049^2~90 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b8ced2895439fd9612bc3bf2485056f41219d03;p=cvc5.git Fix for a memory leak in InstStrategyCegqi. --- 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 ) {