summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Gorrell <micah.gorrell@venafi.com>2023-05-24 10:20:30 -0600
committerLeonardo Hernández <leohdz172@proton.me>2023-05-25 21:21:56 -0600
commit0729f18dce85cb79b8aaac325a43dba0c5e96ab3 (patch)
tree9622fa08df12a55aa816c44f2adc73e64abdf040
parent797e0c74b2cbf4a49f83c9269abec06f3293d00c (diff)
Prevent using a wlr_layer_surface after destroying it, due to no available outputs
-rw-r--r--dwl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index b7436bb..1ad3d05 100644
--- a/dwl.c
+++ b/dwl.c
@@ -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;