summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2019-03-09 23:31:37 +1000
committerStenzek <stenzek@gmail.com>2019-03-29 19:52:38 +1000
commit1151a1238f805d5d0d6b149d12344beb661ba853 (patch)
treeeb7d38bafb545cb56690de06f2408ffce924c11e /Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
parent3d8014beb565d0c18d511438957cbed668da8fb2 (diff)
D3D11: Use ComPtr smart pointer where possible
Diffstat (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
index 05da306a2b..4611d9945d 100644
--- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
@@ -147,7 +147,8 @@ D3DVertexFormat::D3DVertexFormat(const PortableVertexDeclaration& vtx_decl)
D3DVertexFormat::~D3DVertexFormat()
{
ID3D11InputLayout* layout = m_layout.load();
- SAFE_RELEASE(layout);
+ if (layout)
+ layout->Release();
}
ID3D11InputLayout* D3DVertexFormat::GetInputLayout(const void* vs_bytecode, size_t vs_bytecode_size)
@@ -167,7 +168,9 @@ ID3D11InputLayout* D3DVertexFormat::GetInputLayout(const void* vs_bytecode, size
ID3D11InputLayout* expected = nullptr;
if (!m_layout.compare_exchange_strong(expected, layout))
{
- SAFE_RELEASE(layout);
+ if (layout)
+ layout->Release();
+
layout = expected;
}