From db02afefa9ef9f25b00c51aea23811e200fc905e Mon Sep 17 00:00:00 2001 From: narzoul Date: Tue, 29 Dec 2015 16:05:41 +0100 Subject: [PATCH] Fixed issues with making the update thread persistent Earlier the update thread was made persistent accross multiple primary surfaces, but some parts were not correctly updated. The update event handle was still being closed on release of the primary surface, and the update thread still exited if there was no primary surface immediately after it received an update event. --- DDrawCompat/RealPrimarySurface.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/DDrawCompat/RealPrimarySurface.cpp b/DDrawCompat/RealPrimarySurface.cpp index 7aa95a0..9e766e5 100644 --- a/DDrawCompat/RealPrimarySurface.cpp +++ b/DDrawCompat/RealPrimarySurface.cpp @@ -117,9 +117,6 @@ namespace g_paletteConverterSurface = nullptr; } - CloseHandle(g_updateEvent); - g_updateEvent = nullptr; - ZeroMemory(&RealPrimarySurface::s_surfaceDesc, sizeof(RealPrimarySurface::s_surfaceDesc)); Compat::LogLeave("RealPrimarySurface::onRelease"); @@ -147,10 +144,6 @@ namespace while (true) { WaitForSingleObject(g_updateEvent, INFINITE); - if (!g_frontBuffer) - { - return 0; - } Compat::origProcs.AcquireDDThreadLock(); ResetEvent(g_updateEvent);