From 2eaef802061836dd83bbf753174fcb8488b2d8cd Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Wed, 12 Sep 2018 08:28:28 +0100 Subject: i3bar: count references to blocks This prevents blocks from being destroyed before their hotspots are destroyed, in case it is used for a pending click event that fires between the bar receiving a new status, which destroys the block, and the bar rendering the new status, which destroys the hotspot; this problem can be easily produced by scrolling on a block that immediately causes a new status to be sent, with multiple outputs --- swaybar/status_line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swaybar/status_line.c') diff --git a/swaybar/status_line.c b/swaybar/status_line.c index bc47580b..3ba990bd 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c @@ -130,7 +130,7 @@ void status_line_free(struct status_line *status) { case PROTOCOL_I3BAR:; struct i3bar_block *block, *tmp; wl_list_for_each_safe(block, tmp, &status->blocks, link) { - i3bar_block_free(block); + i3bar_block_unref(block); } free(status->i3bar_state.buffer); break; -- cgit v1.2.3