mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-24 12:55:41 +02:00
bar: make sure modules (and particles and fonts!) are destroyed before cleanup
Before shutting down and destroying cairo and XCB, make sure the modules, particles and fonts have been destroyed. I.e. move module destruction from bar's destroy() to the end of bar's run()
This commit is contained in:
parent
092e83680b
commit
b2c9c386d9
1 changed files with 25 additions and 25 deletions
50
bar.c
50
bar.c
|
@ -676,6 +676,31 @@ run(struct bar_run_context *run_ctx)
|
|||
|
||||
LOG_DBG("modules joined");
|
||||
|
||||
for (size_t i = 0; i < bar->left.count; i++) {
|
||||
struct module *m = bar->left.mods[i];
|
||||
struct module_expose_context *e = &bar->left.exps[i];
|
||||
|
||||
if (e->exposable != NULL)
|
||||
m->end_expose(m, e);
|
||||
m->destroy(m);
|
||||
}
|
||||
for (size_t i = 0; i < bar->center.count; i++) {
|
||||
struct module *m = bar->center.mods[i];
|
||||
struct module_expose_context *e = &bar->center.exps[i];
|
||||
|
||||
if (e->exposable != NULL)
|
||||
m->end_expose(m, e);
|
||||
m->destroy(m);
|
||||
}
|
||||
for (size_t i = 0; i < bar->right.count; i++) {
|
||||
struct module *m = bar->right.mods[i];
|
||||
struct module_expose_context *e = &bar->right.exps[i];
|
||||
|
||||
if (e->exposable != NULL)
|
||||
m->end_expose(m, e);
|
||||
m->destroy(m);
|
||||
}
|
||||
|
||||
cairo_destroy(bar->cairo);
|
||||
cairo_surface_destroy(bar->cairo_surface);
|
||||
cairo_debug_reset_static_data();
|
||||
|
@ -705,31 +730,6 @@ destroy(struct bar *bar)
|
|||
{
|
||||
struct private *b = bar->private;
|
||||
|
||||
for (size_t i = 0; i < b->left.count; i++) {
|
||||
struct module *m = b->left.mods[i];
|
||||
struct module_expose_context *e = &b->left.exps[i];
|
||||
|
||||
if (e->exposable != NULL)
|
||||
m->end_expose(m, e);
|
||||
m->destroy(m);
|
||||
}
|
||||
for (size_t i = 0; i < b->center.count; i++) {
|
||||
struct module *m = b->center.mods[i];
|
||||
struct module_expose_context *e = &b->center.exps[i];
|
||||
|
||||
if (e->exposable != NULL)
|
||||
m->end_expose(m, e);
|
||||
m->destroy(m);
|
||||
}
|
||||
for (size_t i = 0; i < b->right.count; i++) {
|
||||
struct module *m = b->right.mods[i];
|
||||
struct module_expose_context *e = &b->right.exps[i];
|
||||
|
||||
if (e->exposable != NULL)
|
||||
m->end_expose(m, e);
|
||||
m->destroy(m);
|
||||
}
|
||||
|
||||
free(b->left.mods);
|
||||
free(b->left.exps);
|
||||
free(b->center.mods);
|
||||
|
|
Loading…
Add table
Reference in a new issue