From ff21b74e7a9ad7d4a45acf46e7d63fb0fe95407a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 4 Oct 2017 16:07:20 +0200 Subject: [PATCH] Add missing locks. --- server/TracyView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 34ec1cb4..a1581a1b 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -419,7 +419,7 @@ void View::ProcessFrameMark( const QueueFrameMark& ev ) const auto lastframe = m_frames.back(); const auto time = ev.time * m_timerMul; assert( lastframe < time ); - std::unique_lock lock( m_lock ); + std::lock_guard lock( m_lock ); m_frames.push_back( time ); } @@ -437,6 +437,7 @@ void View::ProcessZoneName( const QueueZoneName& ev ) assert( !stack.empty() ); auto zone = stack.back(); CheckString( ev.name ); + std::lock_guard lock( m_lock ); GetTextData( *zone )->zoneName = ev.name; } @@ -502,6 +503,7 @@ void View::AddCustomString( uint64_t ptr, std::string&& str ) { auto pit = m_pendingCustomStrings.find( ptr ); assert( pit != m_pendingCustomStrings.end() ); + std::unique_lock lock( m_lock ); auto sit = m_customStrings.find( str.c_str() ); if( sit == m_customStrings.end() ) { @@ -516,6 +518,7 @@ void View::AddCustomString( uint64_t ptr, std::string&& str ) { GetTextData( *pit->second )->userText = *sit; } + lock.unlock(); m_pendingCustomStrings.erase( pit ); }