diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index f1ff24a0ff..c35e22bb56 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -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 diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp index 02db53f688..ef37f7d337 100644 --- a/source/ps/Hotkey.cpp +++ b/source/ps/Hotkey.cpp @@ -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 diff --git a/source/ps/Hotkey.h b/source/ps/Hotkey.h index 27676510fd..cfad324af8 100644 --- a/source/ps/Hotkey.h +++ b/source/ps/Hotkey.h @@ -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);