Fix forms.destroyall() and call it when lua console closes

Fixes #454
This commit is contained in:
Isotarge 2015-11-07 01:38:44 +10:30
parent 26f1c2c2ec
commit 02c04d0088
2 changed files with 3 additions and 3 deletions

View File

@ -190,10 +190,9 @@ namespace BizHawk.Client.EmuHawk
)]
public void DestroyAll()
{
foreach (var form in _luaForms)
for (var i = _luaForms.Count - 1; i >= 0; i--)
{
form.Close();
_luaForms.Remove(form);
_luaForms.ElementAt(i).Close();
}
}

View File

@ -136,6 +136,7 @@ namespace BizHawk.Client.EmuHawk
public void Close()
{
FormsLibrary.DestroyAll();
_lua = new Lua();
GuiLibrary.Dispose();
}