mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 23:47:21 +01:00
Free config before exiting sway.
Apart from freeing the sway_config struct, this also terminates the swaybars spawned by sway, since they are linked by PID to the bar config structs.
This commit is contained in:
parent
e15a8a0376
commit
67bbcceba1
3 changed files with 9 additions and 1 deletions
|
@ -192,6 +192,10 @@ bool load_config(const char *file);
|
|||
/** Reads the config from the given FILE.
|
||||
*/
|
||||
bool read_config(FILE *file, bool is_active);
|
||||
/**
|
||||
* Free config struct
|
||||
*/
|
||||
void free_config(struct sway_config *config);
|
||||
/**
|
||||
* Does variable replacement for a string based on the config's currently loaded variables.
|
||||
*/
|
||||
|
|
|
@ -86,7 +86,7 @@ static void free_workspace_output(struct workspace_output *wo) {
|
|||
free(wo);
|
||||
}
|
||||
|
||||
static void free_config(struct sway_config *config) {
|
||||
void free_config(struct sway_config *config) {
|
||||
int i;
|
||||
for (i = 0; i < config->symbols->length; ++i) {
|
||||
free_variable(config->symbols->items[i]);
|
||||
|
|
|
@ -228,6 +228,10 @@ int main(int argc, char **argv) {
|
|||
|
||||
ipc_terminate();
|
||||
|
||||
if (config) {
|
||||
free_config(config);
|
||||
}
|
||||
|
||||
return exit_value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue