diff --git a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp index d5412d3b..881c761c 100644 --- a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp +++ b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashCli.cpp @@ -134,5 +134,7 @@ void plCrashCli::ReportCrash(PEXCEPTION_POINTERS e) void plCrashCli::WaitForHandle() { - fHandled->Wait(); + // Don't deadlock... Only wait if the CrashSrv is attached + if (fLink && fLink->fSrvReady) + fHandled->Wait(); } diff --git a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashSrv.cpp b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashSrv.cpp index 4b35a6c3..5d5926e2 100644 --- a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashSrv.cpp +++ b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrashSrv.cpp @@ -108,10 +108,11 @@ void plCrashSrv::IHandleCrash() void plCrashSrv::HandleCrash() { -#ifdef HS_BUILD_FOR_WIN32 if (!fLink) FATAL("plCrashMemLink is nil!"); + fLink->fSrvReady = true; // mark us as ready to receive crashes +#ifdef HS_BUILD_FOR_WIN32 // 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() }; @@ -119,8 +120,6 @@ void plCrashSrv::HandleCrash() hsAssert(result != WAIT_FAILED, "WaitForMultipleObjects failed"); #else fCrashed->Wait(); - if (!fLink) - FATAL("plCrashMemLink is nil!"); #endif if (fLink->fCrashed) IHandleCrash(); diff --git a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h index e96f8dc9..70e9ec33 100644 --- a/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h +++ b/Sources/Plasma/FeatureLib/pfCrashHandler/plCrash_Private.h @@ -59,6 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com struct plCrashMemLink { bool fCrashed; + bool fSrvReady; #ifdef HS_BUILD_FOR_WIN32 HANDLE fClientProcess; uint32_t fClientProcessID;