Remove exception handler during profiler destruction.

This commit is contained in:
Bartosz Taudul 2021-07-25 11:48:27 +02:00
parent 61c9e8e6d8
commit 924224501e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 8 additions and 1 deletions

View File

@ -1231,7 +1231,7 @@ void Profiler::SpawnWorkerThreads()
#if defined _WIN32 || defined __CYGWIN__ #if defined _WIN32 || defined __CYGWIN__
s_profilerThreadId = GetThreadId( s_thread->Handle() ); s_profilerThreadId = GetThreadId( s_thread->Handle() );
AddVectoredExceptionHandler( 1, CrashFilter ); m_exceptionHandler = AddVectoredExceptionHandler( 1, CrashFilter );
#endif #endif
#ifdef __linux__ #ifdef __linux__
@ -1263,6 +1263,10 @@ Profiler::~Profiler()
{ {
m_shutdown.store( true, std::memory_order_relaxed ); m_shutdown.store( true, std::memory_order_relaxed );
#if defined _WIN32 || defined __CYGWIN__
if( m_crashHandlerInstalled ) RemoveVectoredExceptionHandler( m_exceptionHandler );
#endif
#ifdef __linux__ #ifdef __linux__
if( m_crashHandlerInstalled ) if( m_crashHandlerInstalled )
{ {

View File

@ -812,6 +812,9 @@ private:
char* m_queryData; char* m_queryData;
char* m_queryDataPtr; char* m_queryDataPtr;
#if defined _WIN32 || defined __CYGWIN__
void* m_exceptionHandler;
#endif
#ifdef __linux__ #ifdef __linux__
struct { struct {
struct sigaction pwr, ill, fpe, segv, pipe, bus, abrt; struct sigaction pwr, ill, fpe, segv, pipe, bus, abrt;