diff options
author | whitertandrek | 2018-03-14 08:00:15 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-04-07 11:33:13 +0200 |
commit | c77e34b607f43d1c3947bc170f701891c59afe0f (patch) | |
tree | 763c1c4b4311e0a1f8251e728ae95a2da853ff91 /engines/plumbers | |
parent | b643af27c3f259afba872332c29c487021b3093b (diff) | |
download | scummvm-rg350-c77e34b607f43d1c3947bc170f701891c59afe0f.tar.gz scummvm-rg350-c77e34b607f43d1c3947bc170f701891c59afe0f.tar.bz2 scummvm-rg350-c77e34b607f43d1c3947bc170f701891c59afe0f.zip |
PLUMBERS: Change file allocation from heap to stack
Diffstat (limited to 'engines/plumbers')
-rw-r--r-- | engines/plumbers/plumbers.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/plumbers/plumbers.cpp b/engines/plumbers/plumbers.cpp index 62e994ec54..d71b7ec113 100644 --- a/engines/plumbers/plumbers.cpp +++ b/engines/plumbers/plumbers.cpp @@ -178,16 +178,15 @@ Common::Error PlumbersGame::run() { void PlumbersGame::loadImage(const Common::String &dirname, const Common::String &filename) { Common::String name = dirname + "/" + filename; debugC(1, kDebugGeneral, "%s : %s", __FUNCTION__, name.c_str()); - Common::File *file = new Common::File(); - if (!file->open(name)) + Common::File file; + if (!file.open(name)) error("unable to load image %s", name.c_str()); delete _image; _image = new Image::BitmapDecoder(); - _image->loadStream(*file); - file->close(); - delete file; + _image->loadStream(file); + file.close(); } void PlumbersGame::drawScreen() { |