Fixed SRAM bug when closing emulator (FolderUtilities would get destroyed before Console, which caused a crash while trying to save the .sav file)

This commit is contained in:
Souryo 2015-07-20 23:20:41 -04:00
parent 97e36a1e27
commit cc67a333c5
3 changed files with 7 additions and 0 deletions

View file

@ -25,6 +25,11 @@ shared_ptr<Console> Console::GetInstance()
return Console::Instance;
}
void Console::Release()
{
Console::Instance.reset(new Console());
}
void Console::Initialize(string filename)
{
MessageManager::SendNotification(ConsoleNotificationType::GameStopped);

View file

@ -61,4 +61,5 @@ class Console
static string GetROMPath();
static shared_ptr<Console> GetInstance();
static void Release();
};

View file

@ -122,6 +122,7 @@ namespace InteropEmu {
DllExport void __stdcall Release()
{
Console::Release();
GameServer::StopServer();
GameClient::Disconnect();
MessageManager::RegisterMessageManager(nullptr);