wayland/surface: Only call destroy func when available
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 1 Oct 2019 14:54:28 +0000 (11:54 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 1 Oct 2019 14:54:28 +0000 (11:54 -0300)
commit655c9dd526912cf551865664a03576abdaa9a76a
tree85dced4bafb842c62000a90c79a21ee42b341f9e
parentbcea96528aad531fa869f0c19200883a2518714e
wayland/surface: Only call destroy func when available

When calling gdk_wayland_surface_export_handle(), if we pass
some 'user_data' but no 'destroy_func', GTK4 crashes. That's
because in xdg_exported_handle() we are unconditionally calling
destroy_func -- even when it's NULL.

Fix that by checking if there's a destroy function before calling
it.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2179
gdk/wayland/gdksurface-wayland.c