1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 20:29:10 +00:00

Fix zombie plCrashHandler issues

Win32 HACK: We wait on both the pfCrashCli handle and the crashed semaphore.
This way, we can proceed to exit pfCrashSrv when the client process exits
insanely.
This commit is contained in:
2012-04-17 15:59:14 -04:00
parent b5f70c4a53
commit 151657a9f2
2 changed files with 26 additions and 3 deletions

View File

@ -108,10 +108,21 @@ void plCrashSrv::IHandleCrash()
void plCrashSrv::HandleCrash()
{
fCrashed->Wait(); // Wait for a crash
#ifdef HS_BUILD_FOR_WIN32
if (!fLink)
FATAL("plCrashMemLink is nil!");
else if (fLink->fCrashed)
// In Win32 land we have to hackily handle the client process exiting, so we'll wait on both
// the crashed semaphore and the client process...
HANDLE hack[2] = { fLink->fClientProcess, fCrashed->GetHandle() };
DWORD result = WaitForMultipleObjects(arrsize(hack), hack, FALSE, INFINITE);
hsAssert(result != WAIT_FAILED, "WaitForMultipleObjects failed");
#else
fCrashed->Wait();
if (!fLink)
FATAL("plCrashMemLink is nil!");
#endif
if (fLink->fCrashed)
IHandleCrash();
fHandled->Signal(); // Tell CrashCli we handled it
}