mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[console] Plug another escape handler leak
This commit is contained in:
parent
fbbf83e696
commit
632d2cb79c
1 changed files with 13 additions and 8 deletions
|
@ -359,6 +359,12 @@ bi_Menu_TopMenu (progs_t *pr)
|
|||
top_menu = strdup (name);
|
||||
}
|
||||
|
||||
static void
|
||||
menu_leave (void *data)
|
||||
{
|
||||
Menu_Leave ();
|
||||
}
|
||||
|
||||
static void
|
||||
bi_Menu_SelectMenu (progs_t *pr)
|
||||
{
|
||||
|
@ -368,7 +374,11 @@ bi_Menu_SelectMenu (progs_t *pr)
|
|||
if (name && *name)
|
||||
menu = Hash_Find (menu_hash, name);
|
||||
if (menu) {
|
||||
Key_SetKeyDest (key_menu);
|
||||
if (Key_GetKeyDest () != key_menu) {
|
||||
menu_keydest = Key_GetKeyDest ();
|
||||
Key_PushEscape (menu_leave, 0);
|
||||
Key_SetKeyDest (key_menu);
|
||||
}
|
||||
if (menu->enter_hook) {
|
||||
run_menu_pre ();
|
||||
PR_ExecuteProgram (&menu_pr_state, menu->enter_hook);
|
||||
|
@ -377,7 +387,7 @@ bi_Menu_SelectMenu (progs_t *pr)
|
|||
} else {
|
||||
if (name && *name)
|
||||
Sys_Printf ("no menu \"%s\"\n", name);
|
||||
Key_PopEscape ();
|
||||
Key_PopEscape ();
|
||||
Key_SetKeyDest (menu_keydest);
|
||||
}
|
||||
}
|
||||
|
@ -463,6 +473,7 @@ bi_Menu_Leave (progs_t *pr)
|
|||
}
|
||||
menu = menu->parent;
|
||||
if (!menu) {
|
||||
Key_PopEscape ();
|
||||
Key_SetKeyDest (menu_keydest);
|
||||
}
|
||||
}
|
||||
|
@ -780,12 +791,6 @@ Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
menu_leave (void *data)
|
||||
{
|
||||
Menu_Leave ();
|
||||
}
|
||||
|
||||
void
|
||||
Menu_Enter ()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue