Skip to content

Commit

Permalink
output-management: Clean up and init resources on destroy
Browse files Browse the repository at this point in the history
If we leave these dangling valgrind will complain and thing will be left
in a bad state for re-attachment.
  • Loading branch information
any1 committed Dec 10, 2023
1 parent a34a2d1 commit fcfd428
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/output-management.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,18 @@ void wlr_output_manager_destroy(void)
if (!wlr_output_manager)
return;

struct output_manager_head* head;
struct output_manager_head* tmp;
wl_list_for_each_safe(head, tmp, &heads, link) {
wl_list_remove(&head->link);
free(head->name);
free(head);
}

zwlr_output_manager_v1_destroy(wlr_output_manager);
wlr_output_manager = NULL;

last_config_serial = 0;
}

bool wlr_output_manager_resize_output(struct output* output,
Expand Down

0 comments on commit fcfd428

Please sign in to comment.