Lua - fix #691 - When calling client.reboot_core we still want to re-inject dependencies to the lua libraries
This commit is contained in:
parent
2b0dc82d16
commit
11b4f5a5b1
|
@ -94,6 +94,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
EmulatorLuaLibrary.YieldCallback = EmuYield;
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
{
|
||||
foreach (var lib in Libraries)
|
||||
{
|
||||
ServiceInjector.UpdateServices(Global.Emulator.ServiceProvider, lib.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public LuaDocumentation Docs { get; private set; }
|
||||
public bool IsRunning { get; set; }
|
||||
public EventWaitHandle LuaWait { get; private set; }
|
||||
|
|
|
@ -135,6 +135,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void Restart()
|
||||
{
|
||||
// Even if the lua console is self-rebooting from client.reboot_core() we still want to re-inject dependencies
|
||||
if (IsRebootingCore)
|
||||
{
|
||||
LuaImp.Restart();
|
||||
return;
|
||||
}
|
||||
|
||||
if (LuaImp != null && LuaImp.GuiLibrary != null && LuaImp.GuiLibrary.HasLuaSurface)
|
||||
{
|
||||
LuaImp.GuiLibrary.DrawFinish();
|
||||
|
|
|
@ -456,12 +456,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, tool.GetType()))
|
||||
{
|
||||
ServiceInjector.UpdateServices(Global.Emulator.ServiceProvider, tool);
|
||||
bool restartTool = false;
|
||||
|
||||
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
|
||||
restartTool = true;
|
||||
if (tool is LuaConsole && ((LuaConsole)tool).IsRebootingCore)
|
||||
restartTool = false;
|
||||
if (restartTool)
|
||||
{
|
||||
tool.Restart();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue