server: release all the resources on exit

Release all the resources including wlr_allocator, wlr_renderer,
wlr_backend and wlr_scene. This makes it a lot easier to detect memory
leaks with ASAN.

On wlroots side, the commit ce615a44 needs to be reverted to detect memory
leaks with EGL renderer.
This commit is contained in:
tokyo4j 2024-11-12 07:46:08 +09:00 committed by Hiroaki Yamamoto
parent 71629741d6
commit eaf11face6
2 changed files with 11 additions and 11 deletions

View file

@ -228,11 +228,12 @@ main(int argc, char *argv[])
session_shutdown(&server);
server_finish(&server);
menu_finish(&server);
theme_finish(&theme);
rcxml_finish();
font_finish();
server_finish(&server);
return 0;
}

View file

@ -627,21 +627,20 @@ server_finish(struct server *server)
{
#if HAVE_XWAYLAND
xwayland_server_finish(server);
#endif
#if HAVE_LIBSFDO
icon_loader_finish(server);
#endif
if (sighup_source) {
wl_event_source_remove(sighup_source);
}
wl_display_destroy_clients(server->wl_display);
wlr_allocator_destroy(server->allocator);
wlr_renderer_destroy(server->renderer);
wlr_backend_destroy(server->backend);
seat_finish(server);
wl_display_destroy(server->wl_display);
/* TODO: clean up various scene_tree nodes */
workspaces_destroy(server);
wlr_scene_node_destroy(&server->scene->tree.node);
wl_display_destroy(server->wl_display);
free(server->ssd_hover_state);
#if HAVE_LIBSFDO
icon_loader_finish(server);
#endif
}