mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix double crash dialog boxes bug
This occurs when the game's unhandled exception handler is getting called after ours. both will create a crashmsg process. This happened as CCrashHandler::End() was called before the in-game exception filter was fired, and therefore CCrashHandler::Handled would return false, and this fire the in-game exception filter. This commit removes the additional check, we just use our vectored exception handler entirely over the game's one, as this one captures everything an unhandled exception handler will capture, and more. The 'Handled' function/fields in CCrashHandler have been renamed to 'Handling', as this is a more appropriate name.
This commit is contained in:
parent
97a6b8b5cc
commit
18e4a262c8
@ -165,7 +165,7 @@ LONG WINAPI TopLevelExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers)
|
||||
{
|
||||
// Don't run the unhandled exception filter from the
|
||||
// game if we have a valid vectored exception filter.
|
||||
if (g_CrashHandler && g_CrashHandler->Handled())
|
||||
if (g_CrashHandler)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
inline bool GetState() const { return m_bCallState; };
|
||||
|
||||
inline bool IsValid() const { return m_hExceptionHandler != nullptr; };
|
||||
inline bool Handled() const { return m_bExceptionHandled; };
|
||||
inline bool Handling() const { return m_bExceptionHandling; };
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Formatters:
|
||||
@ -93,7 +93,7 @@ private:
|
||||
|
||||
bool m_bCallState; // Set when called to prevent recursive calls.
|
||||
bool m_bCrashMsgCreated; // Set when crashmsg.exe is created to prevent recursive messages.
|
||||
bool m_bExceptionHandled; // Set on filter entry, unset within the same lock if exception was not handled, never unset if handled.
|
||||
bool m_bExceptionHandling; // Set on filter entry, unset within the same lock if exception was not handled, never unset if handled.
|
||||
|
||||
std::set<void*> m_WhiteList;
|
||||
mutable std::mutex m_Mutex;
|
||||
|
@ -13,7 +13,7 @@
|
||||
void CCrashHandler::Start()
|
||||
{
|
||||
Lock();
|
||||
m_bExceptionHandled = true;
|
||||
m_bExceptionHandling = true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -21,7 +21,7 @@ void CCrashHandler::Start()
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCrashHandler::End()
|
||||
{
|
||||
m_bExceptionHandled = false;
|
||||
m_bExceptionHandling = false;
|
||||
Unlock();
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ CCrashHandler::CCrashHandler()
|
||||
, m_nCrashMsgFlags(0)
|
||||
, m_bCallState(false)
|
||||
, m_bCrashMsgCreated(false)
|
||||
, m_bExceptionHandled(false)
|
||||
, m_bExceptionHandling(false)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user