From 7c69cfa6de6e09f096ce27e437b4e2ca0b9bc35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 5 Apr 2017 15:57:14 +0200 Subject: [PATCH] [core] destroy surface before context in EGL backend --- platform/linux/src/headless_backend_egl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/linux/src/headless_backend_egl.cpp b/platform/linux/src/headless_backend_egl.cpp index 696fa3065..cfe82d3cc 100644 --- a/platform/linux/src/headless_backend_egl.cpp +++ b/platform/linux/src/headless_backend_egl.cpp @@ -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 {