properly remove items when bar_manager is destroyed

This commit is contained in:
Felix Kratz 2023-08-21 17:55:13 +02:00
parent e67b96aa7d
commit 6d053648d4
3 changed files with 3 additions and 4 deletions

View file

@ -1001,9 +1001,10 @@ void bar_manager_handle_notification(struct bar_manager* bar_manager, struct not
void bar_manager_destroy(struct bar_manager* bar_manager) {
animator_destroy(&bar_manager->animator);
for (int i = 0; i < bar_manager->bar_item_count; i++) {
bar_item_destroy(bar_manager->bar_items[i], true);
while (bar_manager->bar_item_count > 0) {
bar_manager_remove_item(bar_manager, bar_manager->bar_items[0]);
}
if (bar_manager->bar_items) free(bar_manager->bar_items);
for (int i = 0; i < bar_manager->bar_count; i++) {
bar_destroy(bar_manager->bars[i]);

View file

@ -5,7 +5,6 @@
extern char g_config_file[4096];
extern char g_name[256];
pthread_mutex_t hotload_lock;
bool g_hotload = false;
void hotload_set_state(int state) {

View file

@ -28,7 +28,6 @@ struct mach_server {
mach_port_t port;
mach_port_t bs_port;
pthread_t thread;
mach_handler* handler;
};