theme: add theme_finish()

This commit is contained in:
Johan Malm 2021-02-21 22:03:14 +00:00
parent 9f61a819fc
commit cb2a504440
4 changed files with 23 additions and 2 deletions

View file

@ -90,8 +90,10 @@ main(int argc, char *argv[])
wl_display_run(server.wl_display);
server_finish(&server);
menu_finish(&rootmenu);
theme_finish(&theme);
rcxml_finish();
menu_finish(server.rootmenu);
font_finish();
return 0;
}

View file

@ -27,6 +27,7 @@ reload_config_and_theme(void)
/* TODO: use rc.config_path */
rcxml_finish();
rcxml_read(NULL);
theme_finish(g_server->theme);
theme_init(g_server->theme, g_server->renderer, rc.theme_name);
menu_reconfigure(g_server, g_server->rootmenu);
damage_all_outputs(g_server);

View file

@ -9,6 +9,7 @@
#include "common/dir.h"
#include "common/log.h"
#include "common/string-helpers.h"
#include "common/zfree.h"
#include "theme/theme.h"
#include "xbm/xbm.h"
@ -135,3 +136,14 @@ theme_init(struct theme *theme, struct wlr_renderer *renderer,
theme_read(theme, theme_name);
xbm_load(theme, renderer);
}
void
theme_finish(struct theme *theme)
{
zfree(theme->xbm_close_active_unpressed);
zfree(theme->xbm_maximize_active_unpressed);
zfree(theme->xbm_iconify_active_unpressed);
zfree(theme->xbm_close_inactive_unpressed);
zfree(theme->xbm_maximize_inactive_unpressed);
zfree(theme->xbm_iconify_inactive_unpressed);
}