/**
* theme_init - read openbox theme and generate button textures
- * @theme: global theme struct
+ * @theme: theme data
* @renderer: wlr_renderer for creating button textures
* @theme_name: theme-name in <theme-dir>/<theme-name>/openbox-3/themerc
* Note <theme-dir> is obtained in theme-dir.c
void theme_init(struct theme *theme, struct wlr_renderer *renderer,
const char *theme_name);
+/**
+ * theme_finish - free button textures
+ * @theme: theme data
+ */
+void theme_finish(struct theme *theme);
+
/**
* theme_builin - apply built-in theme similar to Clearlooks
* Note: Only used if no theme can be found. Default values for individual
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;
}
/* 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);
#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"
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);
+}