Improve code of func "cleanup"
This commit is contained in:
parent
afb3bc91b5
commit
642a6a37b1
1 changed files with 16 additions and 8 deletions
24
src/dwm.c
24
src/dwm.c
|
@ -459,20 +459,28 @@ void checkotherwm()
|
||||||
void cleanup()
|
void cleanup()
|
||||||
{
|
{
|
||||||
Layout foo = { NULL, NULL };
|
Layout foo = { NULL, NULL };
|
||||||
Monitor *m;
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
selmon->lt[selmon->sellt] = &foo;
|
selmon->lt[selmon->sellt] = &foo;
|
||||||
for (m = mons; m; m = m->next)
|
|
||||||
while (m->stack)
|
for (Monitor *m = mons; m; m = m->next) {
|
||||||
|
while (m->stack) {
|
||||||
unmanage(m->stack, 0);
|
unmanage(m->stack, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
||||||
while (mons)
|
|
||||||
|
while (mons) {
|
||||||
cleanupmon(mons);
|
cleanupmon(mons);
|
||||||
for (i = 0; i < CurLast; i++)
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < CurLast; i++) {
|
||||||
drw_cur_free(drw, cursor[i]);
|
drw_cur_free(drw, cursor[i]);
|
||||||
for (i = 0; i < LENGTH(colors); i++)
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < LENGTH(colors); i++) {
|
||||||
free(scheme[i]);
|
free(scheme[i]);
|
||||||
|
}
|
||||||
|
|
||||||
atoms_destroy(atoms);
|
atoms_destroy(atoms);
|
||||||
XDestroyWindow(dpy, wmcheckwin);
|
XDestroyWindow(dpy, wmcheckwin);
|
||||||
drw_free(drw);
|
drw_free(drw);
|
||||||
|
|
Loading…
Reference in a new issue