diff options
Diffstat (limited to 'engines')
-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() { |