output-management: Clean up and init resources on destroy

If we leave these dangling valgrind will complain and thing will be left
in a bad state for re-attachment.
v0.8
Andri Yngvason 2023-12-10 18:29:03 +00:00
parent a34a2d1cb9
commit fcfd4280b7
1 changed files with 11 additions and 0 deletions

View File

@ -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,