diff options
author | emersion <contact@emersion.fr> | 2018-11-26 23:16:40 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-11-26 23:17:52 +0100 |
commit | a5b8ea90d2b2fe5a56c166d362ced712f6aa35bb (patch) | |
tree | 7c97d1f14b7be6b2dd12a089e4f6a5656848491b /include | |
parent | eaa852ed77f66f782df73a33928717d68937d4b1 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_compositor.h | 4 |
1 files changed, 4 insertions, 0 deletions
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); |