Skip to content

Commit

Permalink
TITANIC: Remove any unfreed parser nodes at the end of sentence parsing
Browse files Browse the repository at this point in the history
This fixes cases like bug #10621, which are somehow resulting from not
all parser nodes being properly freed after parsing the first sentence
finishes
  • Loading branch information
dreammaster committed Jul 14, 2018
1 parent 019a346 commit d39d4b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions engines/titanic/true_talk/tt_parser.cpp
Expand Up @@ -533,6 +533,13 @@ int TTparser::findFrames(TTsentence *sentence) {
status = checkForAction();
}

if (_nodesP) {
// This shouldn't ever happen
warning("Parser had left-over processing nodes");
while (_nodesP)
removeNode(_nodesP);
}

delete line;
return status;
}
Expand Down

0 comments on commit d39d4b9

Please sign in to comment.