From e32e86b65d6d2194bb28cba59eaba3f833e02d15 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Fri, 14 Sep 2018 21:04:43 +0100 Subject: bar: remove i3bar_block_free in favour of i3bar_block_unref --- swaybar/i3bar.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'swaybar') diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c index 1345ee9b..0becae5d 100644 --- a/swaybar/i3bar.c +++ b/swaybar/i3bar.c @@ -8,22 +8,19 @@ #include "swaybar/config.h" #include "swaybar/status_line.h" -static void i3bar_block_free(struct i3bar_block *block) { - if (!block) { +void i3bar_block_unref(struct i3bar_block *block) { + if (block == NULL) { return; } - free(block->full_text); - free(block->short_text); - free(block->align); - free(block->name); - free(block->instance); - free(block->color); - free(block); -} -void i3bar_block_unref(struct i3bar_block *block) { if (--block->ref_count == 0) { - i3bar_block_free(block); + free(block->full_text); + free(block->short_text); + free(block->align); + free(block->name); + free(block->instance); + free(block->color); + free(block); } } -- cgit v1.2.3