about summary refs log tree commit diff stats
path: root/dwm.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-10-20 23:27:31 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-10-20 23:27:31 +0200
commit4a4817b3aa84ac61d6071674d3bbc1af7f69cdb7 (patch)
treeb806096ab94e578e068293aa211639e91a22bd7b /dwm.c
parent7e1182ce555985ff2c5860d88403888eabc6ee4b (diff)
downloaddwm-4a4817b3aa84ac61d6071674d3bbc1af7f69cdb7.tar.gz
dwm: cleanup: free schemes and cursors as array
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index 169adcb..f9e0c3d 100644
--- a/dwm.c
+++ b/dwm.c
@@ -462,6 +462,7 @@ cleanup(void) {
 	Arg a = {.ui = ~0};
 	Layout foo = { "", NULL };
 	Monitor *m;
+	size_t i;
 
 	view(&a);
 	selmon->lt[selmon->sellt] = &foo;
@@ -471,15 +472,13 @@ cleanup(void) {
 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
 	while(mons)
 		cleanupmon(mons);
-	drw_cur_free(drw, cursor[CurNormal]);
-	drw_cur_free(drw, cursor[CurResize]);
-	drw_cur_free(drw, cursor[CurMove]);
-	drw_clr_free(scheme[SchemeNorm].border);
-	drw_clr_free(scheme[SchemeNorm].bg);
-	drw_clr_free(scheme[SchemeNorm].fg);
-	drw_clr_free(scheme[SchemeSel].border);
-	drw_clr_free(scheme[SchemeSel].bg);
-	drw_clr_free(scheme[SchemeSel].fg);
+	for(i = 0; i < CurLast; i++)
+		drw_cur_free(drw, cursor[i]);
+	for(i = 0; i < SchemeLast; i++) {
+		drw_clr_free(scheme[i].border);
+		drw_clr_free(scheme[i].bg);
+		drw_clr_free(scheme[i].fg);
+	}
 	drw_free(drw);
 	XSync(dpy, False);
 	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);