Add destroy helper

This commit is contained in:
2026-07-19 20:14:42 -04:00
parent 7fc72e0b08
commit 9592ca2182
3 changed files with 20 additions and 7 deletions
+14
View File
@@ -295,3 +295,17 @@ NeatBarLayer *neat_bar_layer_create() {
s_current_neat_bar = neat_bar;
return neat_bar;
}
void neat_bar_layer_destroy(NeatBarLayer *neat_bar) {
if (neat_bar == NULL) {
return;
}
bitmap_layer_destroy(neat_bar->down_layer);
bitmap_layer_destroy(neat_bar->select_layer);
bitmap_layer_destroy(neat_bar->up_layer);
layer_destroy(neat_bar->main_layer);
if (s_current_neat_bar == neat_bar) {
s_current_neat_bar = NULL;
}
free(neat_bar);
}