Commit 15d3d300 authored by myfreeweb's avatar myfreeweb Committed by Daniel Stone

desktop-shell: remove surface destroy listener when focus state is destroyed

Changing the focused surface did remove the surface_destroy_listener from the wl_signal list,
but destroying the focus state did not. As a result, sometimes the same listener would be added
to two surfaces, which would join their wl_signal lists together, which would cause infinite
loops and use-after-frees when closing desktop surfaces.
parent ec3f779a
......@@ -663,6 +663,10 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
next = get_default_view(main_surface);
if (next) {
if (state->keyboard_focus) {
state->keyboard_focus = NULL;
activate(state->shell, next, state->seat,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment