Clear unneeded variables upon stopping emulation.

This commit is contained in:
rog 2012-11-24 18:27:20 -05:00
parent d26c7fea17
commit 0c6dad6a37
3 changed files with 9 additions and 5 deletions

View File

@ -293,7 +293,7 @@ void Stop() // - Hammertime!
SConfig::GetInstance().m_SYSCONF->Reload(); SConfig::GetInstance().m_SYSCONF->Reload();
INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----"); INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----");
Movie::g_currentInputCount = 0; Movie::Shutdown();
g_bStopping = false; g_bStopping = false;
} }

View File

@ -163,10 +163,6 @@ void Init()
g_currentFrame = 0; g_currentFrame = 0;
g_currentLagCount = 0; g_currentLagCount = 0;
g_currentInputCount = 0; g_currentInputCount = 0;
// we don't clear these things because otherwise we can't resume playback if we load a movie state later
//g_totalFrames = g_totalBytes = 0;
//delete tmpInput;
//tmpInput = NULL;
} }
else else
std::thread md5thread(CheckMD5); std::thread md5thread(CheckMD5);
@ -1186,4 +1182,11 @@ void CheckMD5()
Core::DisplayMessage("Finished calculating checksum.", 2000); Core::DisplayMessage("Finished calculating checksum.", 2000);
} }
} }
void Shutdown()
{
g_currentInputCount = g_totalInputCount = g_totalFrames = g_totalBytes = 0;
delete [] tmpInput;
tmpInput = NULL;
}
}; };

View File

@ -177,6 +177,7 @@ void EndPlayInput(bool cont);
void SaveRecording(const char *filename); void SaveRecording(const char *filename);
void DoState(PointerWrap &p); void DoState(PointerWrap &p);
void CheckMD5(); void CheckMD5();
void Shutdown();
std::string GetInputDisplay(); std::string GetInputDisplay();