[RFC,v1,10/10] libcamera: software_isp: debayer_egl: Unmake EGL context
diff mbox series

Message ID 20260804101949.353266-11-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • libcamera: software_isp: debayer_egl: Remove some leaks
Related show

Commit Message

Barnabás Pőcze Aug. 4, 2026, 10:19 a.m. UTC
In `SoftwareIsp`, the worker thread is recreated each time it is started.
In order to avoid any potential leaks from the egl implementation, remove
the currently bound egl context in `DebayerEGL::stop()`.

Mesa does not seem to have any destructors for its egl thread data,
so the context in those cases does not seem to be properly destroyed.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/libcamera/software_isp/debayer_egl.cpp | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index afc6b02748..3405cdd56a 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -680,6 +680,7 @@  void DebayerEGL::stop()
 	if (programId_)
 		glDeleteProgram(programId_);
 
+	egl_.makeCurrent(false);
 	egl_.resetEGLContext();
 }