Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
Prevent using a wlr_layer_surface after destroying it, due to no avai…
Browse files Browse the repository at this point in the history
…lable outputs
  • Loading branch information
Micah Gorrell authored and sevz17 committed May 26, 2023
1 parent 797e0c7 commit 0729f18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,10 @@ createlayersurface(struct wl_listener *listener, void *data)
if (!wlr_layer_surface->output)
wlr_layer_surface->output = selmon ? selmon->wlr_output : NULL;

if (!wlr_layer_surface->output)
if (!wlr_layer_surface->output) {
wlr_layer_surface_v1_destroy(wlr_layer_surface);
return;
}

layersurface = ecalloc(1, sizeof(LayerSurface));
layersurface->type = LayerShell;
Expand Down

0 comments on commit 0729f18

Please sign in to comment.