diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index 9902c73b8e..8ebc7151e9 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -38,6 +38,20 @@ namespace BizHawk.Client.EmuHawk return result; } + /// + /// Determines whether a given IToolForm is already loaded + /// + public bool IsLoaded() where T : IToolForm + { + var existingTool = _tools.FirstOrDefault(x => x is T); + if (existingTool != null) + { + return !existingTool.IsDisposed; + } + + return false; + } + /// /// Returns true if an instance of T exists /// @@ -407,7 +421,7 @@ namespace BizHawk.Client.EmuHawk public void LoadRamWatch(bool loadDialog) { - if (Global.Config.RecentWatches.AutoLoad && !Global.Config.RecentWatches.Empty) + if (!IsLoaded() && Global.Config.RecentWatches.AutoLoad && !Global.Config.RecentWatches.Empty) { GlobalWin.Tools.RamWatch.LoadFileFromRecent(Global.Config.RecentWatches[0]); }