diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_input.cpp | 2 | ||||
-rw-r--r-- | src/keyboardconfig.cpp | 6 | ||||
-rw-r--r-- | src/keyboardconfig.h | 2 |
4 files changed, 12 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 79ec041ba..3bd59d7d0 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -764,6 +764,8 @@ void Client::gameClear() delete joystick; joystick = nullptr; + keyboard.deinit(); + if (logger) logger->log1("Quitting10"); diff --git a/src/gui/setup_input.cpp b/src/gui/setup_input.cpp index 144396314..dac4e19ad 100644 --- a/src/gui/setup_input.cpp +++ b/src/gui/setup_input.cpp @@ -178,6 +178,8 @@ Setup_Input::~Setup_Input() mUnassignKeyButton = nullptr; delete mResetKeysButton; mResetKeysButton = nullptr; + delete [] mActionDataSize; + mActionDataSize = nullptr; } void Setup_Input::apply() diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 390634b3c..ddfb30f97 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -52,6 +52,12 @@ void KeyboardConfig::init() mActiveKeys2 = new uint8_t[500]; } +void KeyboardConfig::deinit() +{ + delete [] mActiveKeys2; + mActiveKeys2 = nullptr; +} + int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) const { if (event.key.keysym.sym) diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index fec264da0..2ee708c59 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -45,6 +45,8 @@ class KeyboardConfig */ void init(); + void deinit(); + /** * Get the enable flag, which will stop the user from doing actions. */ |