From 79d8220908c209a4268f29883db121c949b75b1a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 Apr 2023 04:36:12 +0200 Subject: [PATCH] wayland: Don't insta-crash when a surface gets disposed We want to remove the event queue from the list of event queues, not the surface. Otherwise the freed queue stays in the list and the next time an event comes in, we access invalid memory. Fixes thinko introduced in commit 7fafa5133b5. Luckily, we leak all surfaces, so this problem never occured. --- gdk/wayland/gdksurface-wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index a76a2c7247..40b136cb98 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -632,7 +632,7 @@ gdk_wayland_surface_dispose (GObject *object) GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); display_wayland->event_queues = - g_list_remove (display_wayland->event_queues, surface); + g_list_remove (display_wayland->event_queues, impl->event_queue); g_clear_pointer (&impl->event_queue, wl_event_queue_destroy); } -- 2.30.2