From a5b8ea90d2b2fe5a56c166d362ced712f6aa35bb Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 26 Nov 2018 23:16:40 +0100 Subject: surface: fix destroyed subsurfaces handling wlr_subsurface_from_wlr_surface can return NULL if the wl_surface is still alive and if the wl_subsurface has been destroyed. Make sure we check for NULL. Fixes https://github.com/swaywm/sway/issues/3195 --- include/wlr/types/wlr_compositor.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h index 1772e54b..36b9e83f 100644 --- a/include/wlr/types/wlr_compositor.h +++ b/include/wlr/types/wlr_compositor.h @@ -43,6 +43,10 @@ struct wlr_compositor *wlr_compositor_create(struct wl_display *display, bool wlr_surface_is_subsurface(struct wlr_surface *surface); +/** + * Get a subsurface from a surface. Can return NULL if the subsurface has been + * destroyed. + */ struct wlr_subsurface *wlr_subsurface_from_wlr_surface( struct wlr_surface *surface); -- cgit v1.2.3