diff --git a/src/unix/glegl.cpp b/src/unix/glegl.cpp index 8ec9bab1b1..a042885aee 100644 --- a/src/unix/glegl.cpp +++ b/src/unix/glegl.cpp @@ -700,7 +700,7 @@ wxGLCanvasEGL::~wxGLCanvasEGL() } #endif // GDK_WINDOWING_WAYLAND - if ( m_surface ) + if ( m_surface != EGL_NO_SURFACE ) eglDestroySurface(m_display, m_surface); #ifdef GDK_WINDOWING_WAYLAND DestroyWaylandSubsurface();