aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/status_line.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/status_line.c')
-rw-r--r--swaybar/status_line.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c
index 8d781ca3..e0e7414a 100644
--- a/swaybar/status_line.c
+++ b/swaybar/status_line.c
@@ -1,4 +1,4 @@
1#define _POSIX_C_SOURCE 199309L 1#define _POSIX_C_SOURCE 200809L
2#include <fcntl.h> 2#include <fcntl.h>
3#include <json-c/json.h> 3#include <json-c/json.h>
4#include <stdlib.h> 4#include <stdlib.h>
@@ -126,5 +126,17 @@ void status_line_free(struct status_line *status) {
126 close(status->read_fd); 126 close(status->read_fd);
127 close(status->write_fd); 127 close(status->write_fd);
128 kill(status->pid, SIGTERM); 128 kill(status->pid, SIGTERM);
129 switch (status->protocol) {
130 case PROTOCOL_I3BAR:;
131 struct i3bar_block *block, *tmp;
132 wl_list_for_each_safe(block, tmp, &status->blocks, link) {
133 i3bar_block_free(block);
134 }
135 free(status->i3bar_state.buffer);
136 break;
137 default:
138 free(status->text_state.buffer);
139 break;
140 }
129 free(status); 141 free(status);
130} 142}