aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner
diff options
context:
space:
mode:
Diffstat (limited to 'engines/bladerunner')
-rw-r--r--engines/bladerunner/image.cpp5
-rw-r--r--engines/bladerunner/image.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/bladerunner/image.cpp b/engines/bladerunner/image.cpp
index 42070bc84a..157e443384 100644
--- a/engines/bladerunner/image.cpp
+++ b/engines/bladerunner/image.cpp
@@ -34,6 +34,10 @@ Image::Image(BladeRunnerEngine *vm)
{
}
+Image::~Image() {
+ _surface.free();
+}
+
bool Image::open(const Common::String &name) {
Common::SeekableReadStream *stream = _vm->getResourceStream(name);
if (!stream) {
@@ -67,6 +71,7 @@ bool Image::open(const Common::String &name) {
_surface.init(width, height, 2*width, data, pixelFormat);
delete[] buf;
+ delete stream;
return true;
}
diff --git a/engines/bladerunner/image.h b/engines/bladerunner/image.h
index 3980ff4c3c..75991d0f55 100644
--- a/engines/bladerunner/image.h
+++ b/engines/bladerunner/image.h
@@ -37,6 +37,7 @@ class Image {
Graphics::Surface _surface;
public:
Image(BladeRunnerEngine *vm);
+ ~Image();
bool open(const Common::String &name);
void copyToSurface(Graphics::Surface *surface) const;