mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Fix deadlock problems.
This commit is contained in:
parent
b24ac75111
commit
07da2e506a
@ -458,15 +458,28 @@ bool View::DrawImpl()
|
|||||||
ImGui::Begin( tmp, keepOpenPtr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus );
|
ImGui::Begin( tmp, keepOpenPtr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::shared_lock<std::shared_mutex> lock( m_worker.GetDataLock() );
|
if( !m_staticView )
|
||||||
|
{
|
||||||
#if defined TRACY_EXTENDED_FONT
|
#if defined TRACY_EXTENDED_FONT
|
||||||
const char* buttonTitle = ICON_FA_WIFI;
|
if( ImGui::Button( ICON_FA_WIFI ) )
|
||||||
#else
|
#else
|
||||||
const char* buttonTitle = "Connection";
|
if( ImGui::Button( "Connection" ) )
|
||||||
#endif
|
#endif
|
||||||
if ( ImGui::Button( buttonTitle ) )
|
{
|
||||||
ImGui::OpenPopup( "TracyConnectionPopup" );
|
ImGui::OpenPopup( "TracyConnectionPopup" );
|
||||||
ImGui::SameLine();
|
}
|
||||||
|
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.IsDataStatic() )
|
||||||
{
|
{
|
||||||
if( m_worker.IsConnected() )
|
if( m_worker.IsConnected() )
|
||||||
@ -683,18 +696,6 @@ bool View::DrawImpl()
|
|||||||
DrawFrames();
|
DrawFrames();
|
||||||
DrawZones();
|
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();
|
ImGui::End();
|
||||||
|
|
||||||
m_zoneHighlight = nullptr;
|
m_zoneHighlight = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user