AbstractEglBackend: only clean up OpenGL context if primary

This commit is contained in:
Xaver Hugl 2021-06-03 14:38:50 +02:00
parent 74724065ae
commit c5ea99cbe5

View file

@ -104,13 +104,15 @@ void AbstractEglBackend::teardown()
void AbstractEglBackend::cleanup()
{
cleanupGL();
doneCurrent();
eglDestroyContext(m_display, m_context);
cleanupSurfaces();
eglReleaseThread();
kwinApp()->platform()->setSceneEglContext(EGL_NO_CONTEXT);
kwinApp()->platform()->setSceneEglConfig(nullptr);
if (isPrimary()) {
cleanupGL();
doneCurrent();
eglDestroyContext(m_display, m_context);
eglReleaseThread();
kwinApp()->platform()->setSceneEglContext(EGL_NO_CONTEXT);
kwinApp()->platform()->setSceneEglConfig(nullptr);
}
}
void AbstractEglBackend::cleanupSurfaces()