From a693ff2ecfa960b25ac33a936ef8b7b6055e68ae Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 10 Jul 2011 19:23:14 +1000 Subject: [PATCH] CGE: A few more fixes for memory leaks identified by Valgrind --- engines/cge/cge.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 731f92854ef..55b79d5b35d 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -78,7 +78,9 @@ void CGEEngine::setup() { _pocket[i] = new Sprite(this, NULL); _sprite = new Sprite(this, NULL); _miniCave = new Sprite(this, NULL); + _miniCave->_flags._kill = false; _shadow = new Sprite(this, NULL); + _shadow->_flags._kill = false; _horzLine = new HorizLine(this); _infoLine = new InfoLine(this, INFO_W); _cavLight = new CavLight(this); @@ -138,7 +140,7 @@ CGEEngine::~CGEEngine() { // Delete engine objects delete _vga; delete _sys; - delete _sprite; + //delete _sprite; Sprite is destroyed by the queue it's added to delete _miniCave; delete _shadow; delete _horzLine;