mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 15:36:42 +00:00
Fix use of freed memory
This commit is contained in:
parent
f276edddcc
commit
fa0a55c2a9
5 changed files with 15 additions and 7 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <components/translation/translation.hpp>
|
||||
|
||||
#include <components/version/version.hpp>
|
||||
#include <components/openmw-mp/Log.hpp>
|
||||
|
||||
#include "mwinput/inputmanagerimp.hpp"
|
||||
|
||||
|
@ -230,8 +231,11 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
|||
|
||||
OMW::Engine::~Engine()
|
||||
{
|
||||
mwmp::Main::get().getGUIController()->cleanup();
|
||||
mEnvironment.cleanup();
|
||||
|
||||
mwmp::Main::Destroy();
|
||||
|
||||
delete mScriptContext;
|
||||
mScriptContext = NULL;
|
||||
|
||||
|
@ -246,6 +250,9 @@ OMW::Engine::~Engine()
|
|||
}
|
||||
|
||||
SDL_Quit();
|
||||
|
||||
|
||||
LOG_QUIT();
|
||||
}
|
||||
|
||||
void OMW::Engine::enableFSStrict(bool fsStrict)
|
||||
|
@ -719,7 +726,6 @@ void OMW::Engine::go()
|
|||
// Save user settings
|
||||
settings.saveUser(settingspath);
|
||||
|
||||
mwmp::Main::Destroy();
|
||||
std::cout << "Quitting peacefully." << std::endl;
|
||||
}
|
||||
|
||||
|
|
|
@ -387,7 +387,6 @@ int main(int argc, char**argv)
|
|||
std::cout.rdbuf(cout_rdbuf);
|
||||
std::cerr.rdbuf(cerr_rdbuf);
|
||||
|
||||
LOG_QUIT();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -24,9 +24,14 @@ mwmp::GUIController::GUIController(): mInputBox(0)
|
|||
|
||||
mwmp::GUIController::~GUIController()
|
||||
{
|
||||
/* if (mChat != nullptr)
|
||||
|
||||
}
|
||||
|
||||
void mwmp::GUIController::cleanup()
|
||||
{
|
||||
if (mChat != nullptr)
|
||||
delete mChat;
|
||||
mChat = nullptr;*/
|
||||
mChat = nullptr;
|
||||
}
|
||||
|
||||
void mwmp::GUIController::setupChat(const Settings::Manager &mgr)
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace mwmp
|
|||
public:
|
||||
GUIController();
|
||||
~GUIController();
|
||||
void cleanup();
|
||||
void setupChat(const Settings::Manager &manager);
|
||||
|
||||
void PrintChatMessage(std::string &msg);
|
||||
|
|
|
@ -75,7 +75,6 @@ Main::~Main()
|
|||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "TES3MP stopped");
|
||||
delete mNetworking;
|
||||
delete mLocalPlayer;
|
||||
delete mGUIController;
|
||||
Players::CleanUp();
|
||||
}
|
||||
|
||||
|
@ -157,8 +156,6 @@ void Main::Destroy()
|
|||
{
|
||||
assert(pMain);
|
||||
|
||||
delete pMain->mGUIController;
|
||||
|
||||
delete pMain;
|
||||
pMain = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue