bar: remove i3bar_block_free in favour of i3bar_block_unref

This commit is contained in:
Ian Fan 2018-09-14 21:04:43 +01:00
parent f5ecc89c68
commit e32e86b65d

View file

@ -8,10 +8,12 @@
#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;
}
if (--block->ref_count == 0) {
free(block->full_text);
free(block->short_text);
free(block->align);
@ -19,11 +21,6 @@ static void i3bar_block_free(struct i3bar_block *block) {
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);
}
}