create and use menuq_clear() helper; from Tiago Cunha

This commit is contained in:
okan
2012-12-17 14:32:39 +00:00
parent d651c1cc3b
commit 3a3e0383b2
5 changed files with 21 additions and 34 deletions

View File

@@ -250,12 +250,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg)
if (old_cc != NULL)
client_ptrsave(old_cc);
client_ptrwarp(cc);
} else {
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
TAILQ_REMOVE(&menuq, mi, entry);
free(mi);
}
}
} else
menuq_clear(&menuq);
}
void
@@ -280,8 +276,5 @@ mousefunc_menu_cmd(struct client_ctx *cc, void *arg)
if (mi != NULL)
u_spawn(((struct cmd *)mi->ctx)->image);
else
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
TAILQ_REMOVE(&menuq, mi, entry);
free(mi);
}
menuq_clear(&menuq);
}