From 2d252d2dd0c97e1d1def55b9d421db4122d762f2 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 15 Mar 2013 16:11:15 +0000 Subject: [PATCH] memory leak --- moses-cmd/Main.cpp | 2 ++ moses/AlignmentInfoCollection.cpp | 3 +++ moses/AlignmentInfoCollection.h | 1 + 3 files changed, 6 insertions(+) diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp index 9f610204f..117cac3f9 100644 --- a/moses-cmd/Main.cpp +++ b/moses-cmd/Main.cpp @@ -665,6 +665,8 @@ int main(int argc, char** argv) pool.Stop(true); //flush remaining jobs #endif + delete ioWrapper; + } catch (const std::exception &e) { std::cerr << "Exception: " << e.what() << std::endl; return EXIT_FAILURE; diff --git a/moses/AlignmentInfoCollection.cpp b/moses/AlignmentInfoCollection.cpp index 5daba9ba1..53b83d8cd 100644 --- a/moses/AlignmentInfoCollection.cpp +++ b/moses/AlignmentInfoCollection.cpp @@ -30,6 +30,9 @@ AlignmentInfoCollection::AlignmentInfoCollection() m_emptyAlignmentInfo = Add(pairs); } +AlignmentInfoCollection::~AlignmentInfoCollection() +{} + const AlignmentInfo &AlignmentInfoCollection::GetEmptyAlignmentInfo() const { return *m_emptyAlignmentInfo; diff --git a/moses/AlignmentInfoCollection.h b/moses/AlignmentInfoCollection.h index 9c7f75e13..de0949f8f 100644 --- a/moses/AlignmentInfoCollection.h +++ b/moses/AlignmentInfoCollection.h @@ -55,6 +55,7 @@ class AlignmentInfoCollection //! Only a single static variable should be created. AlignmentInfoCollection(); + ~AlignmentInfoCollection(); static AlignmentInfoCollection s_instance;