aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/cursor.cpp5
-rw-r--r--engines/zvision/cursor.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/zvision/cursor.cpp b/engines/zvision/cursor.cpp
index 4731d29f00..bb0700cebe 100644
--- a/engines/zvision/cursor.cpp
+++ b/engines/zvision/cursor.cpp
@@ -81,9 +81,14 @@ ZorkCursor &ZorkCursor::operator=(const ZorkCursor &other) {
_hotspotX = other._hotspotX;
_hotspotY = other._hotspotY;
+ _surface.free();
_surface.copyFrom(other._surface);
return *this;
}
+ZorkCursor::~ZorkCursor() {
+ _surface.free();
+}
+
} // End of namespace ZVision
diff --git a/engines/zvision/cursor.h b/engines/zvision/cursor.h
index ec9f5ed0d7..805a8e7982 100644
--- a/engines/zvision/cursor.h
+++ b/engines/zvision/cursor.h
@@ -42,6 +42,7 @@ public:
ZorkCursor();
ZorkCursor(const Common::String &fileName);
ZorkCursor(const ZorkCursor &other);
+ ~ZorkCursor();
private:
uint16 _width;