diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 315e3c25..05ffc17e 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -37,11 +37,12 @@ Profiler::Profiler() Profiler::~Profiler() { + m_shutdown.store( true, std::memory_order_relaxed ); + m_thread.join(); + assert( s_instance ); s_instance = nullptr; - m_shutdown.store( true, std::memory_order_relaxed ); - m_thread.join(); } uint64_t Profiler::GetNewId() diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 1568b54d..6f9e6339 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -28,11 +28,11 @@ View::View( const char* addr ) View::~View() { - assert( s_instance != nullptr ); - s_instance = nullptr; - m_shutdown.store( true, std::memory_order_relaxed ); m_thread.join(); + + assert( s_instance != nullptr ); + s_instance = nullptr; } bool View::ShouldExit()