Free ran_assignments

When we run 'reload' all the assignments are freed:
e3e09119bf/src/config.c (L99-L109)

Assignments are saved to each window after they are executed:
e3e09119bf/src/assignments.c (L41-L46)

This means that the pointers stored in window->ran_assignments are
invalid (shouldn't be dangerous currently but could lead to a segfault
if the code is modified) after a 'reload'.
This commit is contained in:
Orestis Floros 2018-03-19 03:00:35 +02:00
parent e3e09119bf
commit 98df2e21fa
1 changed files with 9 additions and 3 deletions

View File

@ -160,10 +160,16 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
FREE(barconfig); FREE(barconfig);
} }
/* Invalidate pixmap caches in case font or colors changed */
Con *con; Con *con;
TAILQ_FOREACH(con, &all_cons, all_cons) TAILQ_FOREACH(con, &all_cons, all_cons) {
/* Assignments changed, previously ran assignments are invalid. */
if (con->window) {
con->window->nr_assignments = 0;
FREE(con->window->ran_assignments);
}
/* Invalidate pixmap caches in case font or colors changed. */
FREE(con->deco_render_params); FREE(con->deco_render_params);
}
/* Get rid of the current font */ /* Get rid of the current font */
free_font(); free_font();