mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
bar: call backend->cleanup() when backend->setup() fails
This makes it easier to implement proper cleanup in the backends, as setup() doesn't have to clean up it's own mess upon failure.
This commit is contained in:
parent
0fc5778107
commit
f71aaf9615
1 changed files with 3 additions and 1 deletions
|
@ -245,8 +245,10 @@ run(struct bar *_bar)
|
||||||
|
|
||||||
bar->height_with_border = bar->height + 2 * bar->border.width;
|
bar->height_with_border = bar->height + 2 * bar->border.width;
|
||||||
|
|
||||||
if (!bar->backend.iface->setup(_bar))
|
if (!bar->backend.iface->setup(_bar)) {
|
||||||
|
bar->backend.iface->cleanup(_bar);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
set_cursor(_bar, "left_ptr");
|
set_cursor(_bar, "left_ptr");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue