From 1a5026570af441dd4e9e95ba507a9f6b3e0bebbf Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 Dec 2011 02:13:20 +0100 Subject: KYRA: Slight cleanup. --- engines/kyra/script_eob.cpp | 6 +++--- engines/kyra/script_eob.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/script_eob.cpp b/engines/kyra/script_eob.cpp index e5f26be210..ffdb717484 100644 --- a/engines/kyra/script_eob.cpp +++ b/engines/kyra/script_eob.cpp @@ -157,10 +157,10 @@ EoBInfProcessor::~EoBInfProcessor() { delete[] _flagTable; delete[] _stack; delete[] _scriptData; - for (Common::Array::const_iterator a = _opcodes.begin(); a != _opcodes.end(); ++a) { - delete(*a)->proc; + + for (Common::Array::const_iterator a = _opcodes.begin(); a != _opcodes.end(); ++a) delete *a; - } + _opcodes.clear(); } diff --git a/engines/kyra/script_eob.h b/engines/kyra/script_eob.h index 3804db07c6..66323d6846 100644 --- a/engines/kyra/script_eob.h +++ b/engines/kyra/script_eob.h @@ -91,8 +91,10 @@ private: Screen_EoB *_screen; typedef Common::Functor1Mem InfProc; - struct InfOpcode { + struct InfOpcode : private Common::NonCopyable { InfOpcode(InfProc *p, const char *d) : proc(p), desc(d) {} + ~InfOpcode() { delete proc; } + InfProc *proc; Common::String desc; }; -- cgit v1.2.3