Fix for a memory leak in InstStrategyCegqi.
authorTim King <taking@google.com>
Thu, 24 Mar 2016 17:54:00 +0000 (10:54 -0700)
committerTim King <taking@google.com>
Thu, 24 Mar 2016 17:54:00 +0000 (10:54 -0700)
src/theory/quantifiers/inst_strategy_cbqi.cpp

index faad18c281c1d74a91c0c403a38e2968a47079c7..6ffd913343dca4cb08f0c007b61dd9dd98c57716 100644 (file)
@@ -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 ) {