diff options
author | Paul Gilbert | 2015-10-11 17:30:43 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-10-11 17:30:43 -0400 |
commit | 0231eb22a5e41a1b2b14d649cae5c405ee1fd3ec (patch) | |
tree | 4f0a70628d244560ec29bbeeb61cb8765b57baca /engines | |
parent | 404076dcbea4a6b8a1dc0eec3f4bcbb75296bdd5 (diff) | |
download | scummvm-rg350-0231eb22a5e41a1b2b14d649cae5c405ee1fd3ec.tar.gz scummvm-rg350-0231eb22a5e41a1b2b14d649cae5c405ee1fd3ec.tar.bz2 scummvm-rg350-0231eb22a5e41a1b2b14d649cae5c405ee1fd3ec.zip |
SHERLOCK: RT: Fix memory leak in TattooPerson
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.cpp | 11 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index 46d91cead8..0af8deff9f 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -121,12 +121,13 @@ TattooPerson::TattooPerson() : Person() { _lookHolmes = false; } -void TattooPerson::freeAltGraphics() { - if (_altImages != nullptr) { - delete _altImages; - _altImages = nullptr; - } +TattooPerson::~TattooPerson() { + delete _altImages; +} +void TattooPerson::freeAltGraphics() { + delete _altImages; + _altImages = nullptr; _altSeq = 0; } diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h index 722c4a9aaa..e0d53c67dd 100644 --- a/engines/sherlock/tattoo/tattoo_people.h +++ b/engines/sherlock/tattoo/tattoo_people.h @@ -128,7 +128,7 @@ public: bool _lookHolmes; public: TattooPerson(); - virtual ~TattooPerson() {} + virtual ~TattooPerson(); /** * Clear the NPC related data |