[hackers] [dmenu] free schemes as array || Hiltjo Posthuma

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

commit 164986763a29db97abb52b15cbd282b5636d83c0
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Sun Oct 18 18:37:20 2015 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Sun Oct 18 18:37:20 2015 +0200

    free schemes as array
    
    this makes it slightly easier to add custom schemes aswell

diff --git a/dmenu.c b/dmenu.c
index 4f22ffe..1c2e780 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -92,13 +92,13 @@ calcoffsets(void)
 static void
 cleanup(void)
 {
+ size_t i;
+
         XUngrabKey(dpy, AnyKey, AnyModifier, root);
- drw_clr_free(scheme[SchemeNorm].bg);
- drw_clr_free(scheme[SchemeNorm].fg);
- drw_clr_free(scheme[SchemeSel].fg);
- drw_clr_free(scheme[SchemeSel].bg);
- drw_clr_free(scheme[SchemeOut].fg);
- drw_clr_free(scheme[SchemeOut].bg);
+ for (i = 0; i < SchemeLast; i++) {
+ drw_clr_free(scheme[i].bg);
+ drw_clr_free(scheme[i].fg);
+ }
         drw_free(drw);
         XSync(dpy, False);
         XCloseDisplay(dpy);
Received on Tue Oct 20 2015 - 23:04:13 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 20 2015 - 23:12:11 CEST