From e395d8d15d5b5fe2c9f7098db64c2207285f3e43 Mon Sep 17 00:00:00 2001 From: Mathias Parnaudeau Date: Wed, 12 Feb 2020 22:57:46 +0100 Subject: [PATCH] GRIM: Fix resource leak calling releaseMovieFrame In EMI and GRIM games, a resource leak was found with OpenGL and OpenGL-shaders engines: releaseMovieFrame() was not called in the destructor of these graphics drivers (and never called at all on exit). This patch calls explicitely realeaseMovieFrame. Note that is was already done correctly with TinyGL. --- engines/grim/gfx_opengl.cpp | 1 + engines/grim/gfx_opengl_shaders.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp index 0518407ca34..c312081f790 100644 --- a/engines/grim/gfx_opengl.cpp +++ b/engines/grim/gfx_opengl.cpp @@ -111,6 +111,7 @@ GfxOpenGL::GfxOpenGL() : _smushNumTex(0), } GfxOpenGL::~GfxOpenGL() { + releaseMovieFrame(); delete[] _storedDisplay; if (_emergFont && glIsList(_emergFont)) diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp index a3d6291cc01..cd4ce69252d 100644 --- a/engines/grim/gfx_opengl_shaders.cpp +++ b/engines/grim/gfx_opengl_shaders.cpp @@ -239,6 +239,7 @@ GfxOpenGLS::GfxOpenGLS() { } GfxOpenGLS::~GfxOpenGLS() { + releaseMovieFrame(); for (unsigned int i = 0; i < _numSpecialtyTextures; i++) { destroyTexture(&_specialtyTextures[i]); }