diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 0a8043b16e..aed4489c7c 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -4063,8 +4063,11 @@ xdg_exported_handle (void *data, GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); impl->exported.callback (surface, handle, impl->exported.user_data); - g_clear_pointer (&impl->exported.user_data, - impl->exported.destroy_func); + if (impl->exported.destroy_func) + { + g_clear_pointer (&impl->exported.user_data, + impl->exported.destroy_func); + } } static const struct zxdg_exported_v1_listener xdg_exported_listener = {