From b646700cccd60e7aeaa0d42e155dc669bf45dd25 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 22 Oct 2025 10:25:20 -0700 Subject: [PATCH] fix a rare swapchain leak in PlatformEGL (#9348) If createSwapChain() fails, a SwapChain object is always returned (this might itself be a problem, but we can address that later), however in that case, destroySwapChain() would leak the EGLSwapChain structure. --- filament/backend/src/opengl/platforms/PlatformEGL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filament/backend/src/opengl/platforms/PlatformEGL.cpp b/filament/backend/src/opengl/platforms/PlatformEGL.cpp index 60b22f7d50..b0ce1205bd 100644 --- a/filament/backend/src/opengl/platforms/PlatformEGL.cpp +++ b/filament/backend/src/opengl/platforms/PlatformEGL.cpp @@ -618,8 +618,8 @@ void PlatformEGL::destroySwapChain(SwapChain* swapChain) noexcept { // - this is actually a bit too aggressive, but it is a rare operation. egl.makeCurrent(mEGLDummySurface, mEGLDummySurface); eglDestroySurface(mEGLDisplay, sc->sur); - delete sc; } + delete sc; } }