1. bllip
  2. bllip-parser

Commits

David McClosky  committed 57cf9e2

first-stage/PARSE/parseIt: Fix and simplify chart and sentrep deletion

  • Participants
  • Parent commits 99437a9
  • Branches default

Comments (0)

Files changed (1)

File first-stage/PARSE/parseIt.C

View file
 	  msg += intToString(params.maxSentLen);
 	  WARN( msg.c_str() );
 	  printSkipped(srp,NULL,printStack,printS);
-	  delete srp;
 	  continue;
 	}
 
               if (!topS) {
                   WARN("Reparsing without POS constraints failed too: !topS");
                   printSkipped(srp, chart, printStack, printS);
-                  delete chart;
-                  delete srp;
                   continue;
               }
           } else {
               WARN( "Parse failed: !topS" );
               printSkipped(srp,chart,printStack,printS);
-              delete chart;
-              delete srp;
               continue;
           }
 	}
 
       bool failed = decodeParses(len, locCount, srp, chart, printS, printStack);
       if (failed) {
-        delete chart;
-        delete srp;
         continue;
       }
 
               if (failed || printS.numDiff == 0) {
                 WARN("Parse failed from 0, inf or nan probabililty -- failed even without POS constraints");
                 printSkipped(srp,chart,printStack,printS);
-                delete chart;
-                delete srp;
                 continue;
               }
           } else {
               WARN("Parse failed from 0, inf or nan probabililty");
               printSkipped(srp,chart,printStack,printS);
-              delete chart;
-              delete srp;
               continue;
           }
 	}
     {
       WARN( "Parse failed: chart->findMapParse().empty()" );
       printSkipped(srp,chart,printStack,printS);
-      delete chart;
       return true;
     }
   if(Feature::isLM)
   st->subTrees()=its;
   t=s1;
   delete chart;
+  delete srp;
 }
 
 //------------------------------