charmxi: plug memory leak
authorPhil Miller <mille121@illinois.edu>
Thu, 4 Oct 2012 20:49:15 +0000 (15:49 -0500)
committerPhil Miller <mille121@illinois.edu>
Thu, 4 Oct 2012 20:49:15 +0000 (15:49 -0500)
src/xlat-i/sdag/CSdagConstruct.C

index d52249daa878f1d4c531df9b640baf0a9f845d6c..0479e53571258f82dfc27ba2863ff92613d9ff45 100644 (file)
@@ -355,13 +355,14 @@ void SdagConstruct::propagateState(int uniqueVarNum)
   for(cn=constructs->begin(); !constructs->end(); cn=constructs->next()) {
      cn->propagateState(*stateVarsChildren, *whensEntryMethodStateVars , *publishesList, uniqueVarNum);
   }
+  delete whensEntryMethodStateVars;
 }
 
 
 void SdagConstruct::propagateState(TList<CStateVar*>& list, TList<CStateVar*>& wlist, TList<SdagConstruct*>& publist, int uniqueVarNum)
 {
   CStateVar *sv;
-  TList<CStateVar*> *whensEntryMethodStateVars
+  TList<CStateVar*> *whensEntryMethodStateVars = NULL;
   stateVars = new TList<CStateVar*>();
   switch(type) {
     case SFORALL:
@@ -492,7 +493,8 @@ void SdagConstruct::propagateState(TList<CStateVar*>& list, TList<CStateVar*>& w
       else
          cn->propagateState(*stateVarsChildren, wlist, publist,  uniqueVarNum);
     }
- } 
+  }
+  delete whensEntryMethodStateVars;
 }
 
 void SdagConstruct::generateCode(XStr& decls, XStr& defs, Entry *entry)