From 521f228ceddda2cfc0ed1006682d1b7dfbca7302 Mon Sep 17 00:00:00 2001 From: Julien Templier Date: Thu, 11 Nov 2010 14:19:44 +0000 Subject: LASTEXPRESS: Use SAFE_DELETE for class variables svn-id: r54201 --- engines/lastexpress/data/animation.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'engines/lastexpress/data/animation.cpp') diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 88973c4b0b..3f1383022f 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -31,6 +31,7 @@ #include "lastexpress/data/snd.h" #include "lastexpress/debug.h" +#include "lastexpress/helpers.h" #include "common/events.h" #include "engines/engine.h" @@ -45,21 +46,17 @@ Animation::~Animation() { } void Animation::reset() { - delete _overlay; - _overlay = NULL; - delete _background1; - _background1 = NULL; - delete _background2; - _background2 = NULL; - delete _audio; - _audio = NULL; + SAFE_DELETE(_overlay); + SAFE_DELETE(_background1); + SAFE_DELETE(_background2); + SAFE_DELETE(_audio); _backgroundCurrent = 0; _chunks.clear(); _currentChunk = NULL; - delete _stream; + SAFE_DELETE(_stream); } bool Animation::load(Common::SeekableReadStream *stream, int flag) { -- cgit v1.2.3