Merge pull request #3121 from c-edw/feature/MissingFrees

[WIP] Free unfreed resources.
This commit is contained in:
Drew DeVault 2018-11-14 21:25:26 -05:00 committed by GitHub
commit 484bf591be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 3 deletions

View file

@ -123,6 +123,8 @@ void free_config(struct sway_config *config) {
} }
list_free(config->criteria); list_free(config->criteria);
} }
free_mode(config->current_mode);
free_bar_config(config->current_bar);
list_free(config->no_focus); list_free(config->no_focus);
list_free(config->active_bar_modifiers); list_free(config->active_bar_modifiers);
list_free(config->config_chain); list_free(config->config_chain);

View file

@ -46,6 +46,7 @@ void free_bar_config(struct bar_config *bar) {
free(bar->position); free(bar->position);
free(bar->hidden_state); free(bar->hidden_state);
free(bar->status_command); free(bar->status_command);
free(bar->swaybar_command);
free(bar->font); free(bar->font);
free(bar->separator_symbol); free(bar->separator_symbol);
for (int i = 0; i < bar->bindings->length; i++) { for (int i = 0; i < bar->bindings->length; i++) {

View file

@ -326,6 +326,7 @@ void free_output_config(struct output_config *oc) {
free(oc->name); free(oc->name);
free(oc->background); free(oc->background);
free(oc->background_option); free(oc->background_option);
free(oc->background_fallback);
free(oc); free(oc);
} }

View file

@ -35,18 +35,19 @@ bool criteria_is_empty(struct criteria *criteria) {
} }
void criteria_destroy(struct criteria *criteria) { void criteria_destroy(struct criteria *criteria) {
free(criteria->raw);
free(criteria->cmdlist);
free(criteria->target);
pcre_free(criteria->title); pcre_free(criteria->title);
pcre_free(criteria->shell); pcre_free(criteria->shell);
pcre_free(criteria->app_id); pcre_free(criteria->app_id);
pcre_free(criteria->con_mark);
#ifdef HAVE_XWAYLAND #ifdef HAVE_XWAYLAND
pcre_free(criteria->class); pcre_free(criteria->class);
pcre_free(criteria->instance); pcre_free(criteria->instance);
pcre_free(criteria->window_role); pcre_free(criteria->window_role);
#endif #endif
pcre_free(criteria->con_mark);
free(criteria->workspace); free(criteria->workspace);
free(criteria->cmdlist);
free(criteria->raw);
free(criteria); free(criteria);
} }

View file

@ -13,6 +13,7 @@ static void server_decoration_handle_destroy(struct wl_listener *listener,
wl_list_remove(&deco->destroy.link); wl_list_remove(&deco->destroy.link);
wl_list_remove(&deco->mode.link); wl_list_remove(&deco->mode.link);
wl_list_remove(&deco->link); wl_list_remove(&deco->link);
free(deco->wlr_server_decoration);
free(deco); free(deco);
} }

View file

@ -83,6 +83,7 @@ void free_config(struct swaybar_config *config) {
free(config->mode); free(config->mode);
free(config->hidden_state); free(config->hidden_state);
free(config->sep_symbol); free(config->sep_symbol);
free(config->modifier);
for (int i = 0; i < config->bindings->length; i++) { for (int i = 0; i < config->bindings->length; i++) {
struct swaybar_binding *binding = config->bindings->items[i]; struct swaybar_binding *binding = config->bindings->items[i];
free_binding(binding); free_binding(binding);

View file

@ -183,6 +183,9 @@ void status_line_free(struct status_line *status) {
} }
json_tokener_free(status->tokener); json_tokener_free(status->tokener);
} }
free(status->read);
free(status->write);
free((char*) status->text);
free(status->buffer); free(status->buffer);
free(status); free(status);
} }

View file

@ -412,6 +412,7 @@ void swaynag_destroy(struct swaynag *swaynag) {
free(button); free(button);
} }
list_free(swaynag->buttons); list_free(swaynag->buttons);
free(swaynag->details.button_details);
free(swaynag->details.message); free(swaynag->details.message);
free(swaynag->details.button_up.text); free(swaynag->details.button_up.text);
free(swaynag->details.button_down.text); free(swaynag->details.button_down.text);