diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-10-18 23:27:58 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-10-18 23:27:58 +0300 |
commit | bdb0227ee9648ea96e8ee266d32581c63762b8b0 (patch) | |
tree | 5aff9707a743b3ec5f0e16cba70771b7299516f0 /moses/ChartTranslationOptionList.cpp | |
parent | 7a85126a926c4ffdbd0a956b3b4cec07eea33ed2 (diff) |
Life cycle of TargetPhraseCollection is now managed via shared pointers.
Diffstat (limited to 'moses/ChartTranslationOptionList.cpp')
-rw-r--r-- | moses/ChartTranslationOptionList.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/moses/ChartTranslationOptionList.cpp b/moses/ChartTranslationOptionList.cpp index 8d3d9b3ab..8af2b124d 100644 --- a/moses/ChartTranslationOptionList.cpp +++ b/moses/ChartTranslationOptionList.cpp @@ -115,9 +115,13 @@ void ChartTranslationOptionList::Add(const TargetPhraseCollection &tpc, } } -void ChartTranslationOptionList::AddPhraseOOV(TargetPhrase &phrase, std::list<TargetPhraseCollection*> &waste_memory, const WordsRange &range) +void +ChartTranslationOptionList:: +AddPhraseOOV(TargetPhrase &phrase, + std::list<TargetPhraseCollection::shared_ptr > &waste_memory, + const WordsRange &range) { - TargetPhraseCollection *tpc = new TargetPhraseCollection(); + TargetPhraseCollection::shared_ptr tpc(new TargetPhraseCollection); tpc->Add(&phrase); waste_memory.push_back(tpc); StackVec empty; |