mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Keep remote server connection alive if it disconnects mid-replay
* We need to keep it alive until we've shut down the replay controller, and we keep that alive until the user explicitly closes the capture.
This commit is contained in:
@@ -340,7 +340,16 @@ void ReplayManager::DisconnectFromRemoteServer()
|
||||
if(m_Remote)
|
||||
{
|
||||
QMutexLocker autolock(&m_RemoteLock);
|
||||
m_Remote->ShutdownConnection();
|
||||
// give the remote to the thread to shut down since the lifetime is tied to the replay
|
||||
// controller it has.
|
||||
if(m_Thread->isRunning())
|
||||
{
|
||||
m_OrphanedRemote = m_Remote;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Remote->ShutdownConnection();
|
||||
}
|
||||
}
|
||||
|
||||
m_RemoteHost = RemoteHost();
|
||||
@@ -515,11 +524,22 @@ void ReplayManager::run(int proxyRenderer, const QString &capturefile, const Rep
|
||||
}
|
||||
}
|
||||
|
||||
// close the core renderer
|
||||
if(m_Remote)
|
||||
m_Remote->CloseCapture(m_Renderer);
|
||||
// if the remote has been orphaned due to disconnection during replay, close the capture using it
|
||||
// and then shut it down.
|
||||
if(m_OrphanedRemote)
|
||||
{
|
||||
m_OrphanedRemote->CloseCapture(m_Renderer);
|
||||
m_OrphanedRemote->ShutdownConnection();
|
||||
m_OrphanedRemote = NULL;
|
||||
}
|
||||
else
|
||||
m_Renderer->Shutdown();
|
||||
{
|
||||
// close the core renderer
|
||||
if(m_Remote)
|
||||
m_Remote->CloseCapture(m_Renderer);
|
||||
else
|
||||
m_Renderer->Shutdown();
|
||||
}
|
||||
|
||||
m_Renderer = NULL;
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ private:
|
||||
QMutex m_RemoteLock;
|
||||
RemoteHost m_RemoteHost;
|
||||
IRemoteServer *m_Remote = NULL;
|
||||
IRemoteServer *m_OrphanedRemote = NULL;
|
||||
|
||||
volatile bool m_Running;
|
||||
LambdaThread *m_Thread;
|
||||
|
||||
Reference in New Issue
Block a user