From e45477bf69900a660945b07a75cc7f5da4df268f Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 25 Feb 2016 14:37:58 +0000 Subject: [PATCH] no more leaks --- .../moses2/Search/CubePruningMiniStack/Search.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/other-builds/moses2/Search/CubePruningMiniStack/Search.cpp b/contrib/other-builds/moses2/Search/CubePruningMiniStack/Search.cpp index 779be8075..d5e53b816 100644 --- a/contrib/other-builds/moses2/Search/CubePruningMiniStack/Search.cpp +++ b/contrib/other-builds/moses2/Search/CubePruningMiniStack/Search.cpp @@ -37,6 +37,10 @@ Search::Search(Manager &mgr) Search::~Search() { + for (size_t i = 0; i < m_cubeEdges.size(); ++i) { + CubeEdges *edges = m_cubeEdges[i]; + delete edges; + } } void Search::Decode() @@ -44,7 +48,7 @@ void Search::Decode() // init cue edges m_cubeEdges.resize(mgr.GetInput().GetSize() + 1); for (size_t i = 0; i < m_cubeEdges.size(); ++i) { - m_cubeEdges[i] = new (mgr.GetPool().Allocate()) CubeEdges(); + m_cubeEdges[i] = new CubeEdges(); } const Bitmap &initBitmap = mgr.GetBitmaps().GetInitialBitmap();