1
1
forked from 0ad/0ad

Unload hotkeys on shutdown.

Fixes double registration of hotkeys on engine restart.

This was SVN commit r15755.
This commit is contained in:
leper 2014-09-15 01:27:06 +00:00
parent 28c0b00b2e
commit 66a2fe6308
3 changed files with 11 additions and 2 deletions

View File

@ -582,6 +582,8 @@ static void ShutdownPs()
{
SAFE_DELETE(g_GUI);
UnloadHotkeys();
SAFE_DELETE(g_Console);
// disable the special Windows cursor, or free textures for OGL cursors

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2013 Wildfire Games.
/* Copyright (C) 2014 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -172,6 +172,12 @@ void LoadHotkeys()
}
}
void UnloadHotkeys()
{
g_HotkeyMap.clear();
g_HotkeyStatus.clear();
}
bool isNegated(const SKey& key)
{
// Normal keycodes are below EXTRA_KEYS_BASE

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2012 Wildfire Games.
/* Copyright (C) 2014 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -42,6 +42,7 @@ const int SDL_HOTKEYDOWN = SDL_USEREVENT;
const int SDL_HOTKEYUP = SDL_USEREVENT + 1;
extern void LoadHotkeys();
extern void UnloadHotkeys();
extern InReaction HotkeyInputHandler(const SDL_Event_* ev);
extern bool HotkeyIsPressed(const CStr& keyname);