mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Fix possible race condition with capture loading
* The event browser called SetEventID from OnCaptureLoaded, which would then call OnEventChanged on all viewers, which if they kicked off work could happen at the same time as the later call to OpCaptureLoaded for them. * In the mesh viewer this seemed to lead to a race condition and had a chance to corrupt memory.
This commit is contained in:
@@ -194,9 +194,9 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const rdcstr &origFi
|
||||
|
||||
// make sure we're on a consistent event before invoking viewer forms
|
||||
if(m_LastDrawcall)
|
||||
SetEventID(viewers, m_LastDrawcall->eventId, true);
|
||||
SetEventID(viewers, m_LastDrawcall->eventId, m_LastDrawcall->eventId, true);
|
||||
else if(!m_Drawcalls->empty())
|
||||
SetEventID(viewers, m_Drawcalls->back().eventId, true);
|
||||
SetEventID(viewers, m_Drawcalls->back().eventId, m_Drawcalls->back().eventId, true);
|
||||
|
||||
GUIInvoke::blockcall(m_MainWindow, [&viewers]() {
|
||||
// notify all the registers viewers that a capture has been loaded
|
||||
@@ -213,6 +213,9 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const rdcstr &origFi
|
||||
ShowCommentView();
|
||||
RaiseDockWindow(GetCommentView()->Widget());
|
||||
}
|
||||
|
||||
// refresh the UI without forcing the replay
|
||||
SetEventID({}, m_SelectedEventID, m_EventID, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -252,8 +252,6 @@ void EventBrowser::OnCaptureLoaded()
|
||||
ui->exportDraws->setEnabled(true);
|
||||
ui->stepPrev->setEnabled(true);
|
||||
ui->stepNext->setEnabled(true);
|
||||
|
||||
m_Ctx.SetEventID({this}, lastEIDDraw.first, lastEIDDraw.first);
|
||||
}
|
||||
|
||||
void EventBrowser::OnCaptureClosed()
|
||||
|
||||
Reference in New Issue
Block a user