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
This commit is contained in:
Aliaksandr Kalenik 2024-01-21 13:45:30 +01:00 committed by Andreas Kling
parent 215931daac
commit 21364711da

View file

@ -163,6 +163,11 @@ public:
{
}
~AccelGfxContext()
{
activate();
}
private:
OwnPtr<AccelGfx::Context> m_context;
NonnullRefPtr<AccelGfx::Canvas> m_canvas;