Tastudio - fix stack overflow when user opens tastudio then clicks close rom in emuhawk

This commit is contained in:
adelikat 2014-10-20 00:31:05 +00:00
parent 590766d147
commit 31c564ad06
2 changed files with 12 additions and 1 deletions

View File

@ -3367,6 +3367,7 @@ namespace BizHawk.Client.EmuHawk
// Like reboot core.
private void CloseGame(bool clearSram = false)
{
GameIsClosing = true;
if (clearSram)
{
var path = PathManager.SaveRamPath(Global.Game);
@ -3396,8 +3397,11 @@ namespace BizHawk.Client.EmuHawk
Global.AutoFireController = Global.AutofireNullControls;
RewireSound();
RebootStatusBarIcon.Visible = false;
GameIsClosing = false;
}
public bool GameIsClosing { get; set; } // Let's tools make better decisions when being called by CloseGame
public void CloseRom(bool clearSram = false)
{
//This gets called after Close Game gets called.

View File

@ -35,7 +35,14 @@ namespace BizHawk.Client.EmuHawk
private void NewTasMenuItem_Click(object sender, EventArgs e)
{
StartNewTasMovie();
if (GlobalWin.MainForm.GameIsClosing)
{
Close();
}
else
{
StartNewTasMovie();
}
}
private void OpenTasMenuItem_Click(object sender, EventArgs e)