From: Benjamin Otte Date: Sun, 16 Apr 2023 02:36:12 +0000 (+0200) Subject: wayland: Don't insta-crash when a surface gets disposed X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~4^2~10^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=79d8220908c209a4268f29883db121c949b75b1a;p=gtk4.git 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. --- 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); }