mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 22:13:51 +00:00
Add missing locks.
This commit is contained in:
parent
476597f5ed
commit
cf94b1d2e8
@ -1052,13 +1052,15 @@ void View::HandlePlotName( uint64_t name, std::string&& str )
|
|||||||
if( it == m_plotRev.end() )
|
if( it == m_plotRev.end() )
|
||||||
{
|
{
|
||||||
const auto idx = m_plots.size();
|
const auto idx = m_plots.size();
|
||||||
m_plots.push_back( pit->second );
|
|
||||||
m_plotMap.emplace( name, idx );
|
m_plotMap.emplace( name, idx );
|
||||||
m_plotRev.emplace( str, idx );
|
m_plotRev.emplace( str, idx );
|
||||||
|
std::lock_guard<std::mutex> lock( m_lock );
|
||||||
|
m_plots.push_back( pit->second );
|
||||||
m_strings.emplace( name, std::move( str ) );
|
m_strings.emplace( name, std::move( str ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::mutex> lock( m_lock );
|
||||||
m_plotMap.emplace( name, it->second );
|
m_plotMap.emplace( name, it->second );
|
||||||
const auto& pp = pit->second->data;
|
const auto& pp = pit->second->data;
|
||||||
auto plot = m_plots[it->second];
|
auto plot = m_plots[it->second];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user