From a08116f2d69ccc80a913bbc8633a7f9ad48dafe3 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Fri, 22 Apr 2022 20:03:30 -0700 Subject: [PATCH] Remove explicit lua restart within LoadRomInternal The position of this restart is dangerous as it may pass in a Dispose()'d core. This is pointless too as later on the Tool Manager handles restarting all tools. Similarly, remove the explicit restart of the Debugger, no point in doing this as the Tool Manager will restart the debugger just fine anyways (the restart removes breakpoints from the debugger's internal list but doesn't remove them core side, which they should have been removed anyways from being Dispose()'d) --- src/BizHawk.Client.EmuHawk/MainForm.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index f980472872..8f250f828f 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -3744,11 +3744,6 @@ namespace BizHawk.Client.EmuHawk loader.OnLoadSettings += CoreSettings; loader.OnLoadSyncSettings += CoreSyncSettings; - if (Tools.IsLoaded()) - { - Tools.Restart(); - } - // this also happens in CloseGame(). But it needs to happen here since if we're restarting with the same core, // any settings changes that we made need to make it back to config before we try to instantiate that core with // the new settings objects @@ -3887,13 +3882,6 @@ namespace BizHawk.Client.EmuHawk Console.WriteLine("Core reported BoardID: \"{0}\"", Emulator.AsBoardInfo().BoardName); } - // restarts the lua console if a different rom is loaded. - // im not really a fan of how this is done.. - if (Config.RecentRoms.Empty || Config.RecentRoms.MostRecent != openAdvancedArgs) - { - Tools.Restart(); - } - Config.RecentRoms.Add(openAdvancedArgs); JumpLists.AddRecentItem(openAdvancedArgs, ioa.DisplayName);