forked from RepoMirrors/bemenu
Move side effects after cleanup.
This commit is contained in:
parent
dd4bddcf98
commit
2615c43dc0
13
lib/menu.c
13
lib/menu.c
@ -510,12 +510,6 @@ bmRunResult bmMenuRunWithKey(bmMenu *menu, bmKey key, unsigned int unicode)
|
||||
}
|
||||
break;
|
||||
|
||||
case BM_KEY_RETURN:
|
||||
return BM_RUN_RESULT_SELECTED;
|
||||
|
||||
case BM_KEY_ESCAPE:
|
||||
return BM_RUN_RESULT_CANCEL;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
@ -524,6 +518,13 @@ bmRunResult bmMenuRunWithKey(bmMenu *menu, bmKey key, unsigned int unicode)
|
||||
|
||||
if (oldFilter)
|
||||
free(oldFilter);
|
||||
|
||||
switch (key) {
|
||||
case BM_KEY_RETURN: return BM_RUN_RESULT_SELECTED;
|
||||
case BM_KEY_ESCAPE: return BM_RUN_RESULT_CANCEL;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return BM_RUN_RESULT_RUNNING;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user