Merge pull request #849 from fwSmit/wayland-surface

wayland: fix NULL pointer dereference
This commit is contained in:
Nikos Tsipinakis 2021-05-26 19:52:39 +02:00 committed by GitHub
commit 7d91f978eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,10 +284,12 @@ static void layer_surface_handle_configure(void *data,
static void layer_surface_handle_closed(void *data, static void layer_surface_handle_closed(void *data,
struct zwlr_layer_surface_v1 *surface) { struct zwlr_layer_surface_v1 *surface) {
LOG_I("Destroying layer"); LOG_I("Destroying layer");
zwlr_layer_surface_v1_destroy(ctx.layer_surface); if (ctx.layer_surface)
zwlr_layer_surface_v1_destroy(ctx.layer_surface);
ctx.layer_surface = NULL; ctx.layer_surface = NULL;
wl_surface_destroy(ctx.surface); if (ctx.surface)
wl_surface_destroy(ctx.surface);
ctx.surface = NULL; ctx.surface = NULL;
if (ctx.frame_callback) { if (ctx.frame_callback) {