Skip to content

Commit 3d235b8

Browse files
joanbmvadz
authored andcommitted
Clean up Wayland resources on wxGLCanvas destructor
If the wxGLCanvas is destroyed immediately (without hiding it first), the GTKs widget's `unmap` signal which usually destroys the Wayland resources is not emitted. Thus, we need to ensure they are destroyed on the destructor instead. This fixes an use-after-free issue, sometimes causing a crash, because one of the leaked resources is the canvas's Wayland frame callback. See wxWidgets#24013, wxWidgets#24016. (cherry picked from commit 22ae7a5)
1 parent 45ac258 commit 3d235b8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/unix/glegl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ wxGLCanvasEGL::~wxGLCanvasEGL()
630630
if ( m_surface )
631631
eglDestroySurface(m_display, m_surface);
632632
#ifdef GDK_WINDOWING_WAYLAND
633+
DestroyWaylandSubsurface();
633634
g_clear_pointer(&m_wlEGLWindow, wl_egl_window_destroy);
634635
g_clear_pointer(&m_wlSurface, wl_surface_destroy);
635636

0 commit comments

Comments
 (0)