diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8c0751b8..4bd1cc38 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -660,7 +660,7 @@ void View::ProcessZoneEnd( const QueueZoneEnd& ev ) auto tit = m_threadMap.find( ev.thread ); assert( tit != m_threadMap.end() ); - auto td = m_threads[tit->second]; + auto td = tit->second; auto& stack = td->stack; assert( !stack.empty() ); auto zone = stack.back(); @@ -686,7 +686,7 @@ void View::ProcessZoneText( const QueueZoneText& ev ) auto tit = m_threadMap.find( ev.thread ); assert( tit != m_threadMap.end() ); - auto td = m_threads[tit->second]; + auto td = tit->second; auto& stack = td->stack; assert( !stack.empty() ); auto zone = stack.back(); @@ -1095,18 +1095,18 @@ ThreadData* View::NoticeThread( uint64_t thread ) if( it == m_threadMap.end() ) { CheckThreadString( thread ); - m_threadMap.emplace( thread, (uint32_t)m_threads.size() ); auto td = m_slab.AllocInit(); td->id = thread; td->count = 0; td->showFull = true; td->visible = true; m_threads.push_back( td ); - return m_threads.back(); + m_threadMap.emplace( thread, td ); + return td; } else { - return m_threads[it->second]; + return it->second; } } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 110cb669..d243b7aa 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -188,7 +188,7 @@ private: flat_hash_set> m_pendingThreads; flat_hash_set> m_pendingSourceLocation; flat_hash_map> m_pendingCustomStrings; - flat_hash_map> m_threadMap; + flat_hash_map> m_threadMap; flat_hash_map> m_gpuCtxMap; flat_hash_map> m_plotMap; std::unordered_map m_plotRev;