diff --git a/src/outputs.c b/src/outputs.c index 7886d72..c98160c 100644 --- a/src/outputs.c +++ b/src/outputs.c @@ -684,14 +684,14 @@ void wd_capture_wait(struct wd_state *state, struct wl_display *display) { } void wd_state_destroy(struct wd_state *state) { - struct wd_head *head, *head_tmp; - wl_list_for_each_safe(head, head_tmp, &state->heads, link) { - wd_head_destroy(head); - } struct wd_output *output, *output_tmp; wl_list_for_each_safe(output, output_tmp, &state->outputs, link) { wd_output_destroy(output); } + struct wd_head *head, *head_tmp; + wl_list_for_each_safe(head, head_tmp, &state->heads, link) { + wd_head_destroy(head); + } if (state->layer_shell != NULL) { zwlr_layer_shell_v1_destroy(state->layer_shell); }