Free bar configs on reload and exit

This commit is contained in:
Drew DeVault 2018-03-31 00:35:06 -04:00
parent 0441d12479
commit 18173fb5ad
2 changed files with 12 additions and 7 deletions

View file

@ -16,6 +16,7 @@
#include "log.h"
static void terminate_swaybar(pid_t pid) {
wlr_log(L_DEBUG, "Terminating swaybar %d", pid);
int ret = kill(pid, SIGTERM);
if (ret != 0) {
wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid);
@ -185,6 +186,7 @@ void invoke_swaybar(struct bar_config *bar) {
execvp(cmd[0], cmd);
exit(1);
}
wlr_log(L_DEBUG, "Spawned swaybar %d", bar->pid);
close(filedes[0]);
ssize_t len;
if (read(filedes[1], &len, sizeof(int)) == sizeof(int)) {