[core] destroy surface before context in EGL backend

This commit is contained in:
Konstantin Käfer
2017-04-05 15:57:14 +02:00
parent 038062af86
commit 7c69cfa6de

View File

@@ -31,15 +31,15 @@ struct EGLImpl : public HeadlessBackend::Impl {
}
~EGLImpl() {
if (!eglDestroyContext(display, glContext)) {
throw std::runtime_error("Failed to destroy EGL context.\n");
}
if (glSurface != EGL_NO_SURFACE) {
if (!eglDestroySurface(display, glSurface)) {
throw std::runtime_error("Failed to destroy EGL context.\n");
throw std::runtime_error("Failed to destroy EGL surface.\n");
}
glSurface = EGL_NO_SURFACE;
}
if (!eglDestroyContext(display, glContext)) {
throw std::runtime_error("Failed to destroy EGL context.\n");
}
}
void activateContext() final {