Fix eglDestroySurface() argument order when using EGL with X11

eglDestroySurface takes the display first and the surface second rather
than the other way around. Since both EGLDisplay and EGLSurface are just
typedef'd to void* this doesn't raise a compiler warning. This currently
doesn't crash at runtime because Mesa validates the display pointer
against a list of known good values and fails gracefully, but it still
causes a resource leak.

The wrong call was present since the changes of 23ccdb2 (Improve and
document wxGLCanvas::CreateSurface(), 2023-03-21), see #23366.

Closes #26341.
This commit is contained in:
Florian Larysch
2026-04-03 23:52:22 +02:00
committed by Vadim Zeitlin
parent 2d6aaa14d5
commit a62b291353
+1 -1
View File
@@ -611,7 +611,7 @@ void wxGLCanvasEGL::OnRealized()
{
if ( m_surface != EGL_NO_SURFACE )
{
eglDestroySurface(m_surface, m_display);
eglDestroySurface(m_display, m_surface);
m_surface = EGL_NO_SURFACE;
}