diff --git a/cmd/wm/area.c b/cmd/wm/area.c index 600f614b..ceecf698 100644 --- a/cmd/wm/area.c +++ b/cmd/wm/area.c @@ -37,6 +37,8 @@ destroy_area(Area *a) free(a->client); cext_array_detach((void **)p->area, a, &p->areasz); p->narea--; + if(p->sel >= p->narea) + p->sel = p->narea - 1; free(a); }