mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 14:34:07 +01:00
Merge pull request #2631 from ianyfan/swaybar
bar: remove i3bar_block_free in favour of i3bar_block_unref
This commit is contained in:
commit
b842b4f32e
@ -8,10 +8,12 @@
|
|||||||
#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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (--block->ref_count == 0) {
|
||||||
free(block->full_text);
|
free(block->full_text);
|
||||||
free(block->short_text);
|
free(block->short_text);
|
||||||
free(block->align);
|
free(block->align);
|
||||||
@ -20,11 +22,6 @@ static void i3bar_block_free(struct i3bar_block *block) {
|
|||||||
free(block->color);
|
free(block->color);
|
||||||
free(block);
|
free(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
void i3bar_block_unref(struct i3bar_block *block) {
|
|
||||||
if (--block->ref_count == 0) {
|
|
||||||
i3bar_block_free(block);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i3bar_parse_json(struct status_line *status, const char *text) {
|
static bool i3bar_parse_json(struct status_line *status, const char *text) {
|
||||||
|
Loading…
Reference in New Issue
Block a user