From 6d4758f534102ec071f82285807f35b6c379c0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 9 Sep 2022 18:23:27 +0200 Subject: [PATCH] Platform: properly handle the optional EGL surface in moves. I wonder what kind of bugs this caused. --- src/Magnum/Platform/WindowlessEglApplication.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp index 15b237dde..25b7aec24 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -526,12 +526,18 @@ WindowlessEglContext::WindowlessEglContext(WindowlessEglContext&& other) noexcep _sharedContext{other._sharedContext}, #endif _display{other._display}, _context{other._context} + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) + , _surface{other._surface} + #endif { #ifndef MAGNUM_TARGET_WEBGL other._sharedContext = false; #endif other._display = {}; other._context = {}; + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) + other._surface = {}; + #endif } WindowlessEglContext::~WindowlessEglContext() { @@ -570,6 +576,9 @@ WindowlessEglContext& WindowlessEglContext::operator=(WindowlessEglContext&& oth #endif swap(other._display, _display); swap(other._context, _context); + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) + swap(other._surface, _surface); + #endif return *this; }