diff --git a/src/InputManager.cpp b/src/InputManager.cpp index b28341f59..20e8a17e1 100644 --- a/src/InputManager.cpp +++ b/src/InputManager.cpp @@ -8,12 +8,10 @@ namespace fs = boost::filesystem; -InputManager::InputManager(Window* window) : mWindow(window) +InputManager::InputManager(Window* window) : mWindow(window), + mJoysticks(NULL), mInputConfigs(NULL), mKeyboardInputConfig(NULL), mPrevAxisValues(NULL), + mNumJoysticks(0), mNumPlayers(0) { - mJoysticks = NULL; - mKeyboardInputConfig = NULL; - mNumJoysticks = 0; - mNumPlayers = 0; } InputManager::~InputManager() @@ -66,14 +64,17 @@ void InputManager::deinit() delete mInputConfigs[i]; } - delete mKeyboardInputConfig; + delete[] mInputConfigs; + mInputConfigs = NULL; delete[] mJoysticks; - delete[] mInputConfigs; - delete[] mPrevAxisValues; mJoysticks = NULL; + + delete mKeyboardInputConfig; mKeyboardInputConfig = NULL; - mInputConfigs = NULL; + + delete[] mPrevAxisValues; + mPrevAxisValues = NULL; } SDL_QuitSubSystem(SDL_INIT_JOYSTICK); diff --git a/src/Log.h b/src/Log.h index 901b364ee..fbc033d40 100644 --- a/src/Log.h +++ b/src/Log.h @@ -7,6 +7,7 @@ else Log().get(level) #include #include +#include enum LogLevel { LogError, LogWarning, LogInfo, LogDebug };