mirror of https://github.com/snes9xgit/snes9x.git
win32: fix a crash caused by WatcherThread. Lua Console must dispatch WM_DESTROY instead of WM_CLOSE.
This commit is contained in:
parent
fd07444360
commit
1ba100fed0
|
@ -699,6 +699,10 @@ LRESULT CALLBACK LuaScriptProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
} break;
|
||||
|
||||
case WM_CLOSE:
|
||||
DestroyWindow(hDlg);
|
||||
return true;
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
LuaPerWindowInfo& info = LuaWindowInfo[hDlg];
|
||||
|
||||
|
@ -820,4 +824,12 @@ const char* OpenLuaScript(const char* filename, const char* extraDirToCheck, boo
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void CloseAllLuaWindows()
|
||||
{
|
||||
for (int i = 0; i < LuaScriptHWnds.size(); i++)
|
||||
{
|
||||
SendMessage(LuaScriptHWnds[i], WM_CLOSE, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HAVE_LUA
|
||||
|
|
|
@ -3674,9 +3674,6 @@ int WINAPI WinMain(
|
|||
|
||||
loop_exit:
|
||||
|
||||
#ifdef HAVE_LUA
|
||||
StopAllLuaScripts();
|
||||
#endif
|
||||
CloseAllToolWindows();
|
||||
|
||||
Settings.StopEmulation = TRUE;
|
||||
|
|
Loading…
Reference in New Issue