The code in _gdk_wayland_window_dispose was not safe against being called twice - it would call g_hash_table_destroy twice on the known_globals hash table, the second time operating on freed memory. It was also leaking the list of async_roundtrips.
After fixing both of these issues, the displayclose testcase now works on Wayland.
ea66300 wayland: Make display closing work
gdk/wayland/gdkdisplay-wayland.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
Upstream: git.gnome.org