mirror of
https://github.com/swaywm/sway
synced 2024-11-18 23:14:03 +01:00
bar: remove i3bar_block_free in favour of i3bar_block_unref
This commit is contained in:
parent
f5ecc89c68
commit
e32e86b65d
@ -8,22 +8,19 @@
|
|||||||
#include "swaybar/config.h"
|
#include "swaybar/config.h"
|
||||||
#include "swaybar/status_line.h"
|
#include "swaybar/status_line.h"
|
||||||
|
|
||||||
static void i3bar_block_free(struct i3bar_block *block) {
|
void i3bar_block_unref(struct i3bar_block *block) {
|
||||||
if (!block) {
|
if (block == NULL) {
|
||||||
return;
|
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) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user