Fixed a crash on nvidia when recreating egl context

This commit is contained in:
Deve 2019-03-14 22:56:38 +01:00
parent 4e7526a712
commit 7b58c439fc

View File

@ -507,8 +507,11 @@ bool ContextManagerEGL::createContext()
void ContextManagerEGL::close()
{
eglMakeCurrent(m_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
if (m_egl_display != EGL_NO_DISPLAY)
{
eglMakeCurrent(m_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
}
if (m_egl_context != EGL_NO_CONTEXT)
{
@ -527,6 +530,8 @@ void ContextManagerEGL::close()
eglTerminate(m_egl_display);
m_egl_display = EGL_NO_DISPLAY;
}
eglReleaseThread();
}