[hackers] [dwm] dwm: cleanup: free schemes and cursors as array || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Tue, 20 Oct 2015 23:45:32 +0200 (CEST)

commit 4a4817b3aa84ac61d6071674d3bbc1af7f69cdb7
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Tue Oct 20 23:27:31 2015 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Tue Oct 20 23:27:31 2015 +0200

    dwm: cleanup: free schemes and cursors as array

diff --git a/dwm.c b/dwm.c
index 169adcb..f9e0c3d 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -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;
_AT_@ -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);
Received on Tue Oct 20 2015 - 23:45:32 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 20 2015 - 23:48:14 CEST