diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index cc75696ea..992af1612 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -498,6 +498,11 @@ D3D12DebugManager::~D3D12DebugManager() SAFE_RELEASE(m_DiscardFloatPS); SAFE_RELEASE(m_DiscardIntPS); + SAFE_RELEASE(m_EIPatchRootSig); + SAFE_RELEASE(m_EIPatchBufferData); + SAFE_RELEASE(m_EIPatchPso); + SAFE_RELEASE(m_EIPatchScratchBuffer); + SAFE_RELEASE(m_DebugAlloc); SAFE_RELEASE(m_DebugList); SAFE_RELEASE(m_DebugFence); diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 733385b50..40856c64d 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -77,6 +77,11 @@ void D3D12Replay::Shutdown() FreeLibrary(D3D12Lib); D3D12_CleanupReplaySDK(); + + // we should have unloaded both modules here by now. If we haven't - we probably leaked some D3D12 + // objects. This can cause subsequent captures to fail to open. + RDCASSERT(GetModuleHandleA("d3d12.dll") == NULL); + RDCASSERT(GetModuleHandleA("d3d12core.dll") == NULL); } void D3D12Replay::Initialise(IDXGIFactory1 *factory)