Kill the lua thread as part of closing.

This commit is contained in:
kylethomson 2012-01-29 03:22:05 +00:00
parent 5492a9fd19
commit ca1114311c
3 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ namespace BizHawk.MultiClient
public void Close()
{
LuaKillThread();
lua.Close();
LuaWait.Dispose();
}
@ -118,6 +119,11 @@ namespace BizHawk.MultiClient
isRunning = false;
LuaWait.Set();
}
public void LuaKillThread()
{
if (LuaThread != null)
LuaThread.Abort();
}
public void DoLuaFile(string File)
{

View File

@ -119,6 +119,7 @@ namespace BizHawk.MultiClient
CloseGame();
Global.MovieSession.Movie.StopMovie();
SaveConfig();
LuaConsole1.LuaImp.StopScripts();
};
ResizeBegin += (o, e) =>
@ -364,7 +365,7 @@ namespace BizHawk.MultiClient
{
CurrAviWriter.CloseFile();
CurrAviWriter = null;
}
}
}
void CheckMessages()

View File

@ -93,7 +93,7 @@ namespace BizHawk.MultiClient
private void StopAllScripts()
{
for (int x = 0; x < luaList.Count; x++)
luaList[x].Enabled = false;
luaList[x].Enabled = false;
LuaImp.Close();
LuaImp = new LuaImplementation(this);
}