mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Fix some missing refcount releases
This commit is contained in:
@@ -32,12 +32,12 @@
|
||||
|
||||
class WrappedID3D12GraphicsCommandList;
|
||||
|
||||
struct DummyID3D12DebugCommandList : public ID3D12DebugCommandList
|
||||
struct WrappedID3D12DebugCommandList : public ID3D12DebugCommandList
|
||||
{
|
||||
WrappedID3D12GraphicsCommandList *m_pList;
|
||||
ID3D12DebugCommandList *m_pReal;
|
||||
|
||||
DummyID3D12DebugCommandList() : m_pList(NULL), m_pReal(NULL) {}
|
||||
WrappedID3D12DebugCommandList() : m_pList(NULL), m_pReal(NULL) {}
|
||||
//////////////////////////////
|
||||
// implement IUnknown
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
|
||||
@@ -95,7 +95,7 @@ class WrappedID3D12GraphicsCommandList : public RefCounter12<ID3D12GraphicsComma
|
||||
Serialiser *m_pSerialiser;
|
||||
LogState &m_State;
|
||||
|
||||
DummyID3D12DebugCommandList m_DummyDebug;
|
||||
WrappedID3D12DebugCommandList m_WrappedDebug;
|
||||
|
||||
struct
|
||||
{
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
|
||||
class WrappedID3D12CommandQueue;
|
||||
|
||||
struct DummyID3D12DebugCommandQueue : public ID3D12DebugCommandQueue
|
||||
struct WrappedID3D12DebugCommandQueue : public ID3D12DebugCommandQueue
|
||||
{
|
||||
WrappedID3D12CommandQueue *m_pQueue;
|
||||
ID3D12DebugCommandQueue *m_pReal;
|
||||
|
||||
DummyID3D12DebugCommandQueue() : m_pQueue(NULL), m_pReal(NULL) {}
|
||||
WrappedID3D12DebugCommandQueue() : m_pQueue(NULL), m_pReal(NULL) {}
|
||||
//////////////////////////////
|
||||
// implement IUnknown
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
|
||||
@@ -86,7 +86,7 @@ class WrappedID3D12CommandQueue : public ID3D12CommandQueue,
|
||||
Serialiser *m_pSerialiser;
|
||||
LogState &m_State;
|
||||
|
||||
DummyID3D12DebugCommandQueue m_DummyDebug;
|
||||
WrappedID3D12DebugCommandQueue m_WrappedDebug;
|
||||
|
||||
vector<D3D12ResourceRecord *> m_CmdListRecords;
|
||||
|
||||
|
||||
@@ -111,25 +111,25 @@ D3D12ResourceRecord *GetRecord(ID3D12CommandQueue *obj)
|
||||
return ((WrappedID3D12CommandQueue *)obj)->GetResourceRecord();
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE DummyID3D12DebugCommandQueue::AddRef()
|
||||
ULONG STDMETHODCALLTYPE WrappedID3D12DebugCommandQueue::AddRef()
|
||||
{
|
||||
m_pQueue->AddRef();
|
||||
return 1;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE DummyID3D12DebugCommandQueue::Release()
|
||||
ULONG STDMETHODCALLTYPE WrappedID3D12DebugCommandQueue::Release()
|
||||
{
|
||||
m_pQueue->Release();
|
||||
return 1;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE DummyID3D12DebugCommandList::AddRef()
|
||||
ULONG STDMETHODCALLTYPE WrappedID3D12DebugCommandList::AddRef()
|
||||
{
|
||||
m_pList->AddRef();
|
||||
return 1;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE DummyID3D12DebugCommandList::Release()
|
||||
ULONG STDMETHODCALLTYPE WrappedID3D12DebugCommandList::Release()
|
||||
{
|
||||
m_pList->Release();
|
||||
return 1;
|
||||
@@ -144,7 +144,7 @@ WrappedID3D12CommandQueue::WrappedID3D12CommandQueue(ID3D12CommandQueue *real,
|
||||
RenderDoc::Inst().GetCrashHandler()->RegisterMemoryRegion(this,
|
||||
sizeof(WrappedID3D12CommandQueue));
|
||||
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandQueue), (void **)&m_DummyDebug.m_pReal);
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandQueue), (void **)&m_WrappedDebug.m_pReal);
|
||||
|
||||
if(RenderDoc::Inst().IsReplayApp())
|
||||
{
|
||||
@@ -184,6 +184,8 @@ WrappedID3D12CommandQueue::WrappedID3D12CommandQueue(ID3D12CommandQueue *real,
|
||||
|
||||
WrappedID3D12CommandQueue::~WrappedID3D12CommandQueue()
|
||||
{
|
||||
SAFE_RELEASE(m_WrappedDebug.m_pReal);
|
||||
SAFE_RELEASE(m_pReal);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE WrappedID3D12CommandQueue::QueryInterface(REFIID riid, void **ppvObject)
|
||||
@@ -473,7 +475,7 @@ WrappedID3D12GraphicsCommandList::WrappedID3D12GraphicsCommandList(ID3D12Graphic
|
||||
this, sizeof(WrappedID3D12GraphicsCommandList));
|
||||
|
||||
if(m_pReal)
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandList), (void **)&m_DummyDebug.m_pReal);
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandList), (void **)&m_WrappedDebug.m_pReal);
|
||||
|
||||
if(RenderDoc::Inst().IsReplayApp())
|
||||
{
|
||||
@@ -519,6 +521,8 @@ WrappedID3D12GraphicsCommandList::WrappedID3D12GraphicsCommandList(ID3D12Graphic
|
||||
|
||||
WrappedID3D12GraphicsCommandList::~WrappedID3D12GraphicsCommandList()
|
||||
{
|
||||
SAFE_RELEASE(m_WrappedDebug.m_pReal);
|
||||
SAFE_RELEASE(m_pReal);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE WrappedID3D12GraphicsCommandList::QueryInterface(REFIID riid,
|
||||
|
||||
@@ -318,6 +318,7 @@ WrappedID3D12Device::~WrappedID3D12Device()
|
||||
SAFE_DELETE(m_ResourceManager);
|
||||
|
||||
SAFE_RELEASE(m_pInfoQueue);
|
||||
SAFE_RELEASE(m_WrappedDebug.m_pDebug);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
|
||||
SAFE_DELETE(m_pSerialiser);
|
||||
|
||||
Reference in New Issue
Block a user