From fcadf4511a3f0c68b7c12c9139b3adbbaf52ce46 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 21 Jan 2014 17:11:16 +0000 Subject: [PATCH] leak --- .../TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp index ea60d4d23..8fa9c4ea2 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp @@ -110,6 +110,14 @@ void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(const InputPathList InputPath &inputPath = **iter; GetTargetPhraseCollectionBatch(inputPath); } + + // delete nodes that's been saved + for (iter = inputPathQueue.begin(); iter != inputPathQueue.end(); ++iter) { + InputPath &inputPath = **iter; + const OnDiskPt::PhraseNode *ptNode = static_cast(inputPath.GetPtNode(*this)); + delete ptNode; + } + } void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(InputPath &inputPath) const