From 8634c48c9f80e7febb07fe28e40db61589cea063 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 12 Oct 2017 19:52:18 +0200 Subject: [PATCH] Check for thread existence when adding a lock. --- server/TracyView.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index bd266f7a..5ce54f26 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -716,6 +716,14 @@ void View::InsertZone( Event* zone, Event* parent, Vector& vec ) void View::InsertLockEvent( LockMap& lockmap, LockEvent* lev, uint64_t thread ) { + auto tit = m_threadMap.find( thread ); + if( tit == m_threadMap.end() ) + { + CheckThreadString( thread ); + m_threadMap.emplace( thread, (uint32_t)m_threads.size() ); + m_threads.push_back( new ThreadData { thread, true } ); + } + auto it = lockmap.threadMap.find( thread ); if( it == lockmap.threadMap.end() ) {