diff --git a/src/config.c b/src/config.c index 0917474..a58fa78 100644 --- a/src/config.c +++ b/src/config.c @@ -484,14 +484,11 @@ init_conf(void) } } - seltag = emalloc(screen_count(), sizeof(int)); - - //tags = emalloc(screen_count(), sizeof(Tag*)); - + tags = emalloc(screen_count(), sizeof(Tag*)); for(j = 0; j < screen_count(); ++j) { - //tags[j] = emalloc(conf.ntag, sizeof(Tag)); + tags[j] = emalloc(conf.ntag + 1, sizeof(Tag)); seltag[j] = 1; for(i = 0; i < conf.ntag; ++i) tags[j][i + 1] = conf.tag[i]; diff --git a/src/wmfs.c b/src/wmfs.c index b189a28..fe0084d 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -81,6 +81,7 @@ void quit(void) { Client *c; + int i; /* Set the silent error handler */ XSetErrorHandler(errorhandlerdummy); @@ -95,7 +96,9 @@ quit(void) client_unmanage(c); } - + for(i = 0; i < screen_count(); ++i) + free(tags[i]); + free(tags); XftFontClose(dpy, font); XFreeCursor(dpy, cursor[CurNormal]); XFreeCursor(dpy, cursor[CurMove]); diff --git a/src/wmfs.h b/src/wmfs.h index 096b5b1..fb228a7 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -248,7 +248,7 @@ XftFont *font; /* InfoBar */ InfoBar *infobar; -Tag tags[32][MAXTAG]; +Tag **tags; int *seltag; /* Important Client */