From 59572017b51da88d07744c8feab64d356d2e33ff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 Jun 2012 21:39:08 +0300 Subject: Clean all vars on exit except logger. --- src/client.cpp | 2 ++ src/gui/setup_input.cpp | 2 ++ src/keyboardconfig.cpp | 6 ++++++ src/keyboardconfig.h | 2 ++ 4 files changed, 12 insertions(+) (limited to 'src') 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. */ -- cgit v1.2.3-60-g2f50