From d409620a55c0552d47a75502a35e7c8bde60685d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 29 Dec 2015 00:04:12 -0500 Subject: [PATCH] Fix use-after-free when closing fullscreen views --- sway/handlers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sway/handlers.c b/sway/handlers.c index b8bd9eff..6c6d0e60 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -252,8 +252,12 @@ static void handle_view_destroyed(wlc_handle handle) { } if (view) { - swayc_t *parent = destroy_view(view); + bool fullscreen = swayc_is_fullscreen(view); remove_view_from_scratchpad(view); + swayc_t *parent = destroy_view(view); + if (fullscreen) { + parent->fullscreen = NULL; + } arrange_windows(parent, -1, -1); } else { // Is it unmanaged?