summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/linux/src/headless_backend_egl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/linux/src/headless_backend_egl.cpp b/platform/linux/src/headless_backend_egl.cpp
index 696fa3065c..cfe82d3ccc 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 {