Verify captures are still present before showing them in connection

* If the RenderDoc UI connects to a program, opens then deletes the captures,
  then closes and is opened again - we don't want to report those deleted
  captures as if they still exist. This now clears out any captures that no
  longer exist.
This commit is contained in:
baldurk
2022-03-07 14:45:44 +00:00
parent 4d631e2c72
commit b35b744ada
3 changed files with 9 additions and 0 deletions
+6
View File
@@ -1825,6 +1825,12 @@ void RenderDoc::AddChildThread(uint32_t pid, Threading::ThreadHandle thread)
m_ChildThreads.push_back(make_rdcpair(pid, thread));
}
void RenderDoc::ValidateCaptures()
{
SCOPED_LOCK(m_CaptureLock);
m_Captures.removeIf([](const CaptureData &cap) { return !FileIO::exists(cap.path); });
}
rdcarray<CaptureData> RenderDoc::GetCaptures()
{
SCOPED_LOCK(m_CaptureLock);
+1
View File
@@ -453,6 +453,7 @@ public:
void CompleteChildThread(uint32_t pid);
void AddChildThread(uint32_t pid, Threading::ThreadHandle thread);
void ValidateCaptures();
rdcarray<CaptureData> GetCaptures();
void MarkCaptureRetrieved(uint32_t idx);
+2
View File
@@ -152,6 +152,8 @@ void RenderDoc::TargetControlClientThread(uint32_t version, Network::Socket *cli
const int progresstime = 100; // update capture progress every 100ms
int curtime = 0;
RenderDoc::Inst().ValidateCaptures();
rdcarray<CaptureData> captures;
rdcarray<rdcpair<uint32_t, uint32_t> > children;
std::map<RDCDriver, bool> drivers;