diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index cbbc12ee..42918cdf 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -35,6 +35,8 @@ static moodycamel::ProducerToken& GetToken() return token; } +static std::atomic s_id( 0 ); + #ifndef TRACY_DISABLE Profiler s_profiler; @@ -45,7 +47,6 @@ static Profiler* s_instance = nullptr; Profiler::Profiler() : m_mainThread( GetThreadHandle() ) , m_shutdown( false ) - , m_id( 0 ) , m_stream( LZ4_createStream() ) , m_buffer( new char[TargetFrameSize*3] ) , m_bufferOffset( 0 ) @@ -75,7 +76,7 @@ Profiler::~Profiler() uint64_t Profiler::GetNewId() { - return s_instance->m_id.fetch_add( 1, std::memory_order_relaxed ); + return s_id.fetch_add( 1, std::memory_order_relaxed ); } uint64_t Profiler::ZoneBegin( QueueZoneBegin&& data ) diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index fccf8caf..ffcaa845 100755 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -67,7 +67,6 @@ private: uint64_t m_mainThread; std::thread m_thread; std::atomic m_shutdown; - std::atomic m_id; std::unique_ptr m_sock; LZ4_stream_t* m_stream;