From 21364711da9519deeff45640756c946ee82aa85f Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 21 Jan 2024 13:45:30 +0100 Subject: [PATCH] LibWeb/WebGL: Switch context in AccelGfxContext destructor Destructor of AccelGfxContext needs to make sure that correct OpenGL context is active so that destructors of its members could proceed destroying they resources (for example framebuffer owned by AccelGfx::Canvas). Fixes https://github.com/SerenityOS/serenity/issues/22879 --- Userland/Libraries/LibWeb/WebGL/OpenGLContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWeb/WebGL/OpenGLContext.cpp b/Userland/Libraries/LibWeb/WebGL/OpenGLContext.cpp index b695d5e03dc..03921f23dae 100644 --- a/Userland/Libraries/LibWeb/WebGL/OpenGLContext.cpp +++ b/Userland/Libraries/LibWeb/WebGL/OpenGLContext.cpp @@ -163,6 +163,11 @@ public: { } + ~AccelGfxContext() + { + activate(); + } + private: OwnPtr m_context; NonnullRefPtr m_canvas;