From 3404d191f01414165054d422eb972037b1bb79b6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 22 Jun 2018 00:10:00 +0200 Subject: [PATCH] Fix non-unique child ids in memory window. --- server/TracyView.cpp | 8 ++++---- server/TracyView.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 7099864d..e189d0cb 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4827,13 +4827,13 @@ void View::DrawCallstackWindow() } template -void View::ListMemData( T ptr, T end, std::function DrawAddress ) +void View::ListMemData( T ptr, T end, std::function DrawAddress, const char* id ) { const auto& style = ImGui::GetStyle(); const auto dist = std::distance( ptr, end ) + 1; const auto ty = ImGui::GetTextLineHeight() + style.ItemSpacing.y; - ImGui::BeginChild( "##memScroll", ImVec2( 0, std::max( ty * std::min( dist, 5 ), std::min( ty * dist, ImGui::GetContentRegionAvail().y ) ) ) ); + ImGui::BeginChild( id ? id : "##memScroll", ImVec2( 0, std::max( ty * std::min( dist, 5 ), std::min( ty * dist, ImGui::GetContentRegionAvail().y ) ) ) ); ImGui::Columns( 8 ); ImGui::Text( "Address" ); ImGui::NextColumn(); @@ -5179,7 +5179,7 @@ void View::DrawMemory() ImGui::Text( "0x%" PRIx64 "+%" PRIu64, v->ptr, m_memInfo.ptrFind - v->ptr ); } return v; - } ); + }, "##allocations" ); } } ImGui::TreePop(); @@ -5220,7 +5220,7 @@ void View::DrawMemory() ListMemData( items.begin(), items.end(), []( auto& v ) { ImGui::Text( "0x%" PRIx64, (*v)->ptr ); return *v; - } ); + }, "##activeMem" ); ImGui::TreePop(); } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index fc14b20c..8b62a697 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -85,7 +85,7 @@ private: void DrawCallstackWindow(); template - void ListMemData( T ptr, T end, std::function DrawAddress ); + void ListMemData( T ptr, T end, std::function DrawAddress, const char* id = nullptr ); void DrawInfoWindow(); void DrawZoneInfoWindow();