Tastudio - fix stack overflow when user opens tastudio then clicks close rom in emuhawk
This commit is contained in:
parent
590766d147
commit
31c564ad06
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue