mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Fix leak of renderer when we fail to create a GL context
This commit is contained in:
parent
752f0a988b
commit
f1c459fd6c
@ -98,12 +98,13 @@ EGLRenderer::~EGLRenderer()
|
|||||||
SDL_assert(m_glDeleteVertexArraysOES != nullptr);
|
SDL_assert(m_glDeleteVertexArraysOES != nullptr);
|
||||||
m_glDeleteVertexArraysOES(1, &m_VAO);
|
m_glDeleteVertexArraysOES(1, &m_VAO);
|
||||||
}
|
}
|
||||||
if (m_DummyRenderer) {
|
|
||||||
SDL_DestroyRenderer(m_DummyRenderer);
|
|
||||||
}
|
|
||||||
SDL_GL_DeleteContext(m_Context);
|
SDL_GL_DeleteContext(m_Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_DummyRenderer) {
|
||||||
|
SDL_DestroyRenderer(m_DummyRenderer);
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the global properties back to what they were before
|
// Reset the global properties back to what they were before
|
||||||
SDL_SetHint(SDL_HINT_OPENGL_ES_DRIVER, "0");
|
SDL_SetHint(SDL_HINT_OPENGL_ES_DRIVER, "0");
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, m_OldContextProfileMask);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, m_OldContextProfileMask);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user