no more leaks

This commit is contained in:
Hieu Hoang 2016-02-25 14:37:58 +00:00
parent 0c1a976baa
commit e45477bf69

View File

@ -37,6 +37,10 @@ Search::Search(Manager &mgr)
Search::~Search() Search::~Search()
{ {
for (size_t i = 0; i < m_cubeEdges.size(); ++i) {
CubeEdges *edges = m_cubeEdges[i];
delete edges;
}
} }
void Search::Decode() void Search::Decode()
@ -44,7 +48,7 @@ void Search::Decode()
// init cue edges // init cue edges
m_cubeEdges.resize(mgr.GetInput().GetSize() + 1); m_cubeEdges.resize(mgr.GetInput().GetSize() + 1);
for (size_t i = 0; i < m_cubeEdges.size(); ++i) { for (size_t i = 0; i < m_cubeEdges.size(); ++i) {
m_cubeEdges[i] = new (mgr.GetPool().Allocate<CubeEdges>()) CubeEdges(); m_cubeEdges[i] = new CubeEdges();
} }
const Bitmap &initBitmap = mgr.GetBitmaps().GetInitialBitmap(); const Bitmap &initBitmap = mgr.GetBitmaps().GetInitialBitmap();