diff options
author | okan <okan> | 2012-12-17 14:32:39 +0000 |
---|---|---|
committer | okan <okan> | 2012-12-17 14:32:39 +0000 |
commit | 3a3e0383b2b605ede516f4f58eef778bea7815e4 (patch) | |
tree | 9aa77f0f9c343b5caa6887d28283047cda0154bb /mousefunc.c | |
parent | d651c1cc3b5b1f4c00cbefd6247083c5f3f0fce5 (diff) | |
download | cwm-3a3e0383b2b605ede516f4f58eef778bea7815e4.tar.gz cwm-3a3e0383b2b605ede516f4f58eef778bea7815e4.tar.xz cwm-3a3e0383b2b605ede516f4f58eef778bea7815e4.zip |
create and use menuq_clear() helper; from Tiago Cunha
Diffstat (limited to 'mousefunc.c')
-rw-r--r-- | mousefunc.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/mousefunc.c b/mousefunc.c index a342b8e..eb5171a 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -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); } |