mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-27 05:40:17 +00:00
properly release image on background destruction
This commit is contained in:
parent
118190bfbc
commit
4d76e2e932
4 changed files with 9 additions and 0 deletions
|
@ -99,6 +99,10 @@ void background_draw(struct background* background, CGContextRef context) {
|
|||
draw_rect(context, background->bounds, &background->color, background->corner_radius, background->border_width, &background->border_color, false);
|
||||
}
|
||||
|
||||
void background_destroy(struct background* background) {
|
||||
image_destroy(&background->image);
|
||||
}
|
||||
|
||||
static bool background_parse_sub_domain(struct background* background, FILE* rsp, struct token property, char* message) {
|
||||
if (token_equals(property, PROPERTY_DRAWING))
|
||||
return background_set_enabled(background, evaluate_boolean_state(get_token(&message), background->enabled));
|
||||
|
|
|
@ -408,6 +408,8 @@ void bar_item_destroy(struct bar_item* bar_item) {
|
|||
else if (bar_item->group) group_remove_member(bar_item->group, bar_item);
|
||||
env_vars_destroy(&bar_item->signal_args.env_vars);
|
||||
popup_destroy(&bar_item->popup);
|
||||
background_destroy(&bar_item->background);
|
||||
|
||||
free(bar_item);
|
||||
}
|
||||
|
||||
|
|
|
@ -436,6 +436,8 @@ void bar_manager_destroy(struct bar_manager* bar_manager) {
|
|||
bar_destroy(bar_manager->bars[i]);
|
||||
}
|
||||
custom_events_destroy(&bar_manager->custom_events);
|
||||
background_destroy(&bar_manager->background);
|
||||
|
||||
if (bar_manager->bars) free(bar_manager->bars);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ void text_destroy_line(struct text* text) {
|
|||
}
|
||||
|
||||
void text_destroy(struct text* text) {
|
||||
background_destroy(&text->background);
|
||||
if (text->string) free(text->string);
|
||||
if (text->font_name) free(text->font_name);
|
||||
if (text->font) CFRelease(text->font);
|
||||
|
|
Loading…
Reference in a new issue