diff options
author | Paul Gilbert | 2018-07-14 13:51:06 -0700 |
---|---|---|
committer | Paul Gilbert | 2018-07-14 13:51:06 -0700 |
commit | d39d4b9d4b9b344fd28a56ec8bea3c266747ea50 (patch) | |
tree | 6a7260e9f6b6f954c6ca3dddc82b78f1dedabe60 | |
parent | 019a3461cd77e626089974b43ae1caba0c7f6418 (diff) | |
download | scummvm-rg350-d39d4b9d4b9b344fd28a56ec8bea3c266747ea50.tar.gz scummvm-rg350-d39d4b9d4b9b344fd28a56ec8bea3c266747ea50.tar.bz2 scummvm-rg350-d39d4b9d4b9b344fd28a56ec8bea3c266747ea50.zip |
TITANIC: Remove any unfreed parser nodes at the end of sentence parsing
This fixes cases like bug #10621, which are somehow resulting from not
all parser nodes being properly freed after parsing the first sentence
finishes
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index 2caeef45dd..6b69c903e4 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -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; } |