diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp index 481263444b8..972c7a41860 100644 --- a/engines/teenagent/surface_list.cpp +++ b/engines/teenagent/surface_list.cpp @@ -30,6 +30,10 @@ namespace TeenAgent { SurfaceList::SurfaceList() : surfaces(NULL), surfaces_n(0) {} +SurfaceList::~SurfaceList() { + free(); +} + void SurfaceList::load(Common::SeekableReadStream *stream, Type type, int sub_hack) { free(); diff --git a/engines/teenagent/surface_list.h b/engines/teenagent/surface_list.h index 289148af6ca..23e0ff423af 100644 --- a/engines/teenagent/surface_list.h +++ b/engines/teenagent/surface_list.h @@ -35,6 +35,7 @@ public: enum Type { kTypeOn }; SurfaceList(); + ~SurfaceList(); void load(Common::SeekableReadStream *stream, Type type, int sub_hack = 0); void free(); void render(Graphics::Surface *surface, const Common::Rect & clip) const;