mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Ensure replay controller only gets deleted via Shutdown()
This commit is contained in:
@@ -1648,7 +1648,7 @@ rdcpair<ReplayStatus, IReplayController *> RemoteServer::OpenCapture(
|
||||
|
||||
if(status != ReplayStatus::Succeeded)
|
||||
{
|
||||
SAFE_DELETE(rend);
|
||||
rend->Shutdown();
|
||||
ret.first = status;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,10 @@ rdcpair<ReplayStatus, IReplayController *> CaptureFile::OpenCapture(const Replay
|
||||
RenderDoc::Inst().SetProgressCallback<LoadProgress>(RENDERDOC_ProgressCallback());
|
||||
|
||||
if(ret != ReplayStatus::Succeeded)
|
||||
SAFE_DELETE(render);
|
||||
{
|
||||
render->Shutdown();
|
||||
render = NULL;
|
||||
}
|
||||
|
||||
return rdcpair<ReplayStatus, IReplayController *>(ret, render);
|
||||
}
|
||||
|
||||
@@ -65,27 +65,6 @@ ReplayController::ReplayController()
|
||||
ReplayController::~ReplayController()
|
||||
{
|
||||
CHECK_REPLAY_THREAD();
|
||||
|
||||
RDCLOG("Shutting down replay renderer");
|
||||
|
||||
for(size_t i = 0; i < m_Outputs.size(); i++)
|
||||
SAFE_DELETE(m_Outputs[i]);
|
||||
|
||||
m_Outputs.clear();
|
||||
|
||||
for(auto it = m_CustomShaders.begin(); it != m_CustomShaders.end(); ++it)
|
||||
m_pDevice->FreeCustomShader(*it);
|
||||
|
||||
m_CustomShaders.clear();
|
||||
|
||||
for(auto it = m_TargetResources.begin(); it != m_TargetResources.end(); ++it)
|
||||
m_pDevice->FreeTargetResource(*it);
|
||||
|
||||
m_TargetResources.clear();
|
||||
|
||||
if(m_pDevice)
|
||||
m_pDevice->Shutdown();
|
||||
m_pDevice = NULL;
|
||||
}
|
||||
|
||||
void ReplayController::SetFrameEvent(uint32_t eventId, bool force)
|
||||
@@ -1855,6 +1834,27 @@ void ReplayController::Shutdown()
|
||||
{
|
||||
CHECK_REPLAY_THREAD();
|
||||
|
||||
RDCLOG("Shutting down replay renderer");
|
||||
|
||||
for(size_t i = 0; i < m_Outputs.size(); i++)
|
||||
SAFE_DELETE(m_Outputs[i]);
|
||||
|
||||
m_Outputs.clear();
|
||||
|
||||
for(auto it = m_CustomShaders.begin(); it != m_CustomShaders.end(); ++it)
|
||||
m_pDevice->FreeCustomShader(*it);
|
||||
|
||||
m_CustomShaders.clear();
|
||||
|
||||
for(auto it = m_TargetResources.begin(); it != m_TargetResources.end(); ++it)
|
||||
m_pDevice->FreeTargetResource(*it);
|
||||
|
||||
m_TargetResources.clear();
|
||||
|
||||
if(m_pDevice)
|
||||
m_pDevice->Shutdown();
|
||||
m_pDevice = NULL;
|
||||
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ struct ReplayController : public IReplayController
|
||||
{
|
||||
public:
|
||||
ReplayController();
|
||||
virtual ~ReplayController();
|
||||
|
||||
APIProperties GetAPIProperties();
|
||||
|
||||
@@ -219,6 +218,7 @@ public:
|
||||
void Shutdown();
|
||||
|
||||
private:
|
||||
virtual ~ReplayController();
|
||||
ReplayStatus PostCreateInit(IReplayDriver *device, RDCFile *rdc);
|
||||
|
||||
void FetchPipelineState(uint32_t eventId);
|
||||
|
||||
Reference in New Issue
Block a user