1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add user data storage handler.

This commit is contained in:
Bartosz Taudul
2019-07-26 23:05:24 +02:00
parent 34cc7183d0
commit 27965e8690
6 changed files with 108 additions and 0 deletions
+3
View File
@@ -109,6 +109,7 @@ View::View( const char* addr, ImFont* fixedWidth, ImFont* bigFont, SetTitleCallb
, m_textEditorFont( fixedWidth )
, m_bigFont( bigFont )
, m_stcb( stcb )
, m_userData()
{
assert( s_instance == nullptr );
s_instance = this;
@@ -125,6 +126,7 @@ View::View( FileRead& f, ImFont* fixedWidth, ImFont* bigFont, SetTitleCallback s
, m_textEditorFont( fixedWidth )
, m_bigFont( bigFont )
, m_stcb( stcb )
, m_userData( m_worker.GetCaptureProgram().c_str(), m_worker.GetCaptureTime() )
{
assert( s_instance == nullptr );
s_instance = this;
@@ -379,6 +381,7 @@ bool View::DrawImpl()
return !wasCancelled;
}
if( !m_userData.Valid() ) m_userData.Init( m_worker.GetCaptureProgram().c_str(), m_worker.GetCaptureTime() );
if( m_saveThreadState.load( std::memory_order_relaxed ) == SaveThreadState::NeedsJoin )
{
m_saveThread.join();