Skip to content

Commit 86585b6

Browse files
committed
Fix some leaks creating root signature blobs
1 parent f7eccf0 commit 86585b6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

renderdoc/driver/d3d12/d3d12_postvs.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -2206,11 +2206,13 @@ void D3D12Replay::InitPostMSBuffers(uint32_t eventId)
22062206
ID3D12RootSignature *annotatedSig = NULL;
22072207

22082208
{
2209-
ID3DBlob *root = m_pDevice->GetShaderCache()->MakeRootSig(modsig);
2209+
ID3DBlob *blob = m_pDevice->GetShaderCache()->MakeRootSig(modsig);
22102210
HRESULT hr =
2211-
m_pDevice->CreateRootSignature(0, root->GetBufferPointer(), root->GetBufferSize(),
2211+
m_pDevice->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(),
22122212
__uuidof(ID3D12RootSignature), (void **)&annotatedSig);
22132213

2214+
SAFE_RELEASE(blob);
2215+
22142216
if(annotatedSig == NULL || FAILED(hr))
22152217
{
22162218
ret.ampout.status = ret.meshout.status = StringFormat::Fmt(

renderdoc/driver/d3d12/d3d12_shader_feedback.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1336,9 +1336,12 @@ bool D3D12Replay::FetchShaderFeedback(uint32_t eventId)
13361336

13371337
if(annotatedSig == NULL || FAILED(hr))
13381338
{
1339+
SAFE_RELEASE(root);
13391340
RDCERR("Couldn't create feedback modified root signature: %s", ToStr(hr).c_str());
13401341
return false;
13411342
}
1343+
1344+
SAFE_RELEASE(root);
13421345
}
13431346

13441347
ID3D12PipelineState *annotatedPipe = NULL;

0 commit comments

Comments
 (0)