Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-08-04 16:55:42 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-08-04 16:55:42 +0300
commit07da2e506a94bd71c51a6003793c549e1ee088c9 (patch)
tree40b05b51a003dfa40444835e1c0f8cc9c5ca2cde /server/TracyView.cpp
parentb24ac75111e46949506f848edc2423ca0407c092 (diff)
Fix deadlock problems.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r--server/TracyView.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp
index 7ad4b900..42c5fe9f 100644
--- a/server/TracyView.cpp
+++ b/server/TracyView.cpp
@@ -458,15 +458,28 @@ bool View::DrawImpl()
ImGui::Begin( tmp, keepOpenPtr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus );
#endif
- std::shared_lock<std::shared_mutex> lock( m_worker.GetDataLock() );
+ if( !m_staticView )
+ {
#if defined TRACY_EXTENDED_FONT
- const char* buttonTitle = ICON_FA_WIFI;
+ if( ImGui::Button( ICON_FA_WIFI ) )
#else
- const char* buttonTitle = "Connection";
+ if( ImGui::Button( "Connection" ) )
#endif
- if ( ImGui::Button( buttonTitle ) )
- ImGui::OpenPopup( "TracyConnectionPopup" );
- ImGui::SameLine();
+ {
+ ImGui::OpenPopup( "TracyConnectionPopup" );
+ }
+ ImGui::SameLine();
+ if( ImGui::BeginPopup( "TracyConnectionPopup" ) )
+ {
+ const bool wasDisconnectIssued = m_disconnectIssued;
+ const bool discardData = !DrawConnection();
+ const bool disconnectIssuedJustNow = m_disconnectIssued != wasDisconnectIssued;
+ if( discardData ) keepOpen = false;
+ if( disconnectIssuedJustNow || discardData ) ImGui::CloseCurrentPopup();
+ ImGui::EndPopup();
+ }
+ }
+ std::shared_lock<std::shared_mutex> lock( m_worker.GetDataLock() );
if( !m_worker.IsDataStatic() )
{
if( m_worker.IsConnected() )
@@ -683,18 +696,6 @@ bool View::DrawImpl()
DrawFrames();
DrawZones();
- if( ImGui::BeginPopup( "TracyConnectionPopup" ) )
- {
- bool wasDisconnectIssued = m_disconnectIssued;
- bool discardData = !DrawConnection();
- bool disconnectIssuedJustNow = m_disconnectIssued != wasDisconnectIssued;
- if( discardData )
- keepOpen = false;
- if( disconnectIssuedJustNow || discardData )
- ImGui::CloseCurrentPopup();
- ImGui::EndPopup();
- }
-
ImGui::End();
m_zoneHighlight = nullptr;