Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2013-07-18 23:39:15 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-07-18 23:39:15 +0400
commit6088531dfe8828bd6b3f2c51a4fe4aaf5ff2cd53 (patch)
treeea794305e77cc9fd6e88db204acaebf400341ab1 /moses/InputPath.cpp
parent0b5776faf7919d51e64f9bc8c9973c5e3caa96ad (diff)
starting placeholder
Diffstat (limited to 'moses/InputPath.cpp')
-rw-r--r--moses/InputPath.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/moses/InputPath.cpp b/moses/InputPath.cpp
index 9e93219eb..e9f84b643 100644
--- a/moses/InputPath.cpp
+++ b/moses/InputPath.cpp
@@ -1,5 +1,6 @@
#include "InputPath.h"
#include "ScoreComponentCollection.h"
+#include "TargetPhraseCollection.h"
namespace Moses
{
@@ -15,6 +16,14 @@ InputPath::InputPath(const Phrase &phrase, const WordsRange &range, const InputP
InputPath::~InputPath()
{
delete m_inputScore;
+
+ // detach target phrase before delete objects from m_copiedSet
+ // the phrase dictionary owns the target phrases so they should be doing the deleting
+ std::vector<TargetPhraseCollection>::iterator iter;
+ for (iter = m_copiedSet.begin(); iter != m_copiedSet.end(); ++iter) {
+ TargetPhraseCollection &coll = *iter;
+ coll.Detach();
+ }
}
const TargetPhraseCollection *InputPath::GetTargetPhrases(const PhraseDictionary &phraseDictionary) const