Fixed crash that occurred at shutdown when a Lua script save confirmation popup was shown (only when "Pause when in the background" option is enabled)

This commit is contained in:
Sour 2018-01-03 01:14:46 -05:00
parent e8858a1a2f
commit 1e76d25986
3 changed files with 15 additions and 3 deletions

View file

@ -26,6 +26,11 @@ VideoRenderer::~VideoRenderer()
StopThread();
}
void VideoRenderer::Release()
{
Instance.reset();
}
void VideoRenderer::StartThread()
{
if(!_renderThread) {

View file

@ -27,6 +27,8 @@ public:
VideoRenderer();
~VideoRenderer();
static void Release();
void StartThread();
void StopThread();

View file

@ -313,6 +313,14 @@ namespace InteropEmu {
DllExport void __stdcall Release()
{
_shortcutKeyHandler.reset();
Console::GetInstance()->Stop();
VideoDecoder::GetInstance()->StopThread();
VideoDecoder::Release();
VideoRenderer::GetInstance()->StopThread();
VideoRenderer::Release();
Console::Release();
GameServer::StopServer();
@ -327,9 +335,6 @@ namespace InteropEmu {
delete _soundManager;
_soundManager = nullptr;
}
VideoDecoder::GetInstance()->StopThread();
VideoDecoder::Release();
}
DllExport void __stdcall TakeScreenshot() { VideoDecoder::GetInstance()->TakeScreenshot(); }