diff options
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/video_surface.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/support/video_surface.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp index fd570e5d9a..7455e8cfef 100644 --- a/engines/titanic/support/video_surface.cpp +++ b/engines/titanic/support/video_surface.cpp @@ -41,8 +41,6 @@ CVideoSurface::CVideoSurface(CScreenManager *screenManager) : } CVideoSurface::~CVideoSurface() { - if (_ddSurface) - _videoSurfaceCounter -= freeSurface(); --_videoSurfaceCounter; if (_freeTransparencySurface == DisposeAfterUse::YES) @@ -334,6 +332,11 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey } } +OSVideoSurface::~OSVideoSurface() { + if (_ddSurface) + _videoSurfaceCounter -= OSVideoSurface::freeSurface(); +} + void OSVideoSurface::loadResource(const CResourceKey &key) { _resourceKey = key; _pendingLoad = true; diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h index 690669b79b..390e70bc33 100644 --- a/engines/titanic/support/video_surface.h +++ b/engines/titanic/support/video_surface.h @@ -356,6 +356,7 @@ class OSVideoSurface : public CVideoSurface { public: OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface); OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false); + ~OSVideoSurface(); /** * Load the surface with the passed resource |