Merge pull request #3353 from orestisf1993/free_ws_assignments

Free ws_assignments on reload
This commit is contained in:
Ingo Bürk 2018-08-09 16:49:21 +02:00 committed by GitHub
commit 4b3ff9cdd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -97,9 +97,8 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
FREE(mode);
}
struct Assignment *assign;
while (!TAILQ_EMPTY(&assignments)) {
assign = TAILQ_FIRST(&assignments);
struct Assignment *assign = TAILQ_FIRST(&assignments);
if (assign->type == A_TO_WORKSPACE || assign->type == A_TO_WORKSPACE_NUMBER)
FREE(assign->dest.workspace);
else if (assign->type == A_COMMAND)
@ -111,6 +110,14 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
FREE(assign);
}
while (!TAILQ_EMPTY(&ws_assignments)) {
struct Workspace_Assignment *assign = TAILQ_FIRST(&ws_assignments);
FREE(assign->name);
FREE(assign->output);
TAILQ_REMOVE(&ws_assignments, assign, ws_assignments);
FREE(assign);
}
/* Clear bar configs */
Barconfig *barconfig;
while (!TAILQ_EMPTY(&barconfigs)) {