ToolManager - manage IsHandleCreated and IsDisposed logic when deciding to restart a tool, still todo: a billion tools do this logic unnecessarily now

This commit is contained in:
adelikat 2014-12-17 03:21:32 +00:00
parent 6ac789f5e8
commit 53dc38ee66
2 changed files with 5 additions and 1 deletions

View File

@ -44,6 +44,7 @@ namespace BizHawk.Client.EmuHawk
void Show();
void Close();
bool IsDisposed { get; }
bool IsHandleCreated { get; }
}
[AttributeUsage(AttributeTargets.Property)]

View File

@ -201,7 +201,10 @@ namespace BizHawk.Client.EmuHawk
if (IsAvailable(tool.GetType()))
{
UpdateServices(tool);
tool.Restart();
if ((tool.IsHandleCreated && !tool.IsDisposed) || tool is RamWatch) // Hack for Ram Watch - in display watches mode it wants to keep running even closed, it will handle disposed logic
{
tool.Restart();
}
}
else
{