aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/support/video_surface.cpp5
-rw-r--r--engines/titanic/support/video_surface.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 49388b64d8..594f660937 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -33,7 +33,7 @@ CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
_pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
_movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT),
- _field48(0), _hasFrame(true), _lockCount(0) {
+ _freeMovieSurface(DisposeAfterUse::NO), _hasFrame(true), _lockCount(0) {
_videoSurfaceNum = _videoSurfaceCounter++;
}
@@ -41,6 +41,9 @@ CVideoSurface::~CVideoSurface() {
if (_ddSurface)
_videoSurfaceCounter -= freeSurface();
--_videoSurfaceCounter;
+
+ if (_freeMovieSurface == DisposeAfterUse::YES)
+ delete _movieFrameSurface;
}
void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 0e777bac1e..1f3a0fa2b3 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -65,7 +65,7 @@ protected:
Graphics::ManagedSurface *_rawSurface;
bool _pendingLoad;
Graphics::ManagedSurface *_movieFrameSurface;
- int _field48;
+ DisposeAfterUse::Flag _freeMovieSurface;
int _videoSurfaceNum;
bool _hasFrame;
int _lockCount;