OPENGLSDL: Make sure pipeline is destroyed when Manager is destroyed

When destroying the Manager its context is always destroyed.
Destroying OpenGLGraphicsManager must destroy the pipeline too.
This commit is contained in:
Le Philousophe 2023-02-12 18:05:09 +01:00
parent 42a533cd02
commit 4a7d75595d
2 changed files with 5 additions and 0 deletions

View File

@ -103,6 +103,7 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
#if !USE_FORCED_GLES
ShaderManager::destroy();
#endif
delete _pipeline;
}
bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) const {

View File

@ -190,6 +190,10 @@ OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() {
#if SDL_VERSION_ATLEAST(2, 0, 0)
notifyContextDestroy();
SDL_GL_DeleteContext(_glContext);
#else
if (_hwScreen) {
notifyContextDestroy();
}
#endif
}