diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-30 21:39:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-30 21:39:08 +0300 |
commit | 59572017b51da88d07744c8feab64d356d2e33ff (patch) | |
tree | cfa6f63762f71876716fcfec73abf28327198d08 | |
parent | fce58131916103f3c2120adafcf59895a402a634 (diff) | |
download | manaverse-59572017b51da88d07744c8feab64d356d2e33ff.tar.gz manaverse-59572017b51da88d07744c8feab64d356d2e33ff.tar.bz2 manaverse-59572017b51da88d07744c8feab64d356d2e33ff.tar.xz manaverse-59572017b51da88d07744c8feab64d356d2e33ff.zip |
Clean all vars on exit except logger.
-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. */ |