diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-09-12 08:28:28 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-09-12 08:28:28 +0100 |
commit | 2eaef802061836dd83bbf753174fcb8488b2d8cd (patch) | |
tree | 33fcd285cc70a6cea257b1f3b6d24121d340a270 /swaybar/status_line.c | |
parent | Merge pull request #2620 from ianyfan/commands (diff) | |
download | sway-2eaef802061836dd83bbf753174fcb8488b2d8cd.tar.gz sway-2eaef802061836dd83bbf753174fcb8488b2d8cd.tar.zst sway-2eaef802061836dd83bbf753174fcb8488b2d8cd.zip |
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
Diffstat (limited to 'swaybar/status_line.c')
-rw-r--r-- | swaybar/status_line.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { | |||
130 | case PROTOCOL_I3BAR:; | 130 | case PROTOCOL_I3BAR:; |
131 | struct i3bar_block *block, *tmp; | 131 | struct i3bar_block *block, *tmp; |
132 | wl_list_for_each_safe(block, tmp, &status->blocks, link) { | 132 | wl_list_for_each_safe(block, tmp, &status->blocks, link) { |
133 | i3bar_block_free(block); | 133 | i3bar_block_unref(block); |
134 | } | 134 | } |
135 | free(status->i3bar_state.buffer); | 135 | free(status->i3bar_state.buffer); |
136 | break; | 136 | break; |