Fix reference release (#2217)

* Fix reference release

* Use DX_RELEASE
This commit is contained in:
Wencey Wang 2020-07-27 03:59:45 +00:00 committed by GitHub
parent 9e5e34f018
commit 1f53c6c246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -471,14 +471,15 @@ namespace bgfx
if (NULL != swapChainPanelNative)
{
hr = swapChainPanelNative->SetSwapChain(*_swapChain);
if (FAILED(hr) )
{
DX_RELEASE(swapChainPanelNative, 0);
BX_TRACE("Failed to SetSwapChain, hr %x.");
return hr;
}
swapChainPanelNative->Release();
DX_RELEASE_I(swapChainPanelNative);
}
}
else
@ -499,14 +500,15 @@ namespace bgfx
if (NULL != swapChainBackgroundPanelNative)
{
hr = swapChainBackgroundPanelNative->SetSwapChain(*_swapChain);
if (FAILED(hr) )
{
DX_RELEASE(swapChainBackgroundPanelNative, 0);
BX_TRACE("Failed to SetSwapChain, hr %x.");
return hr;
}
swapChainBackgroundPanelNative->Release();
DX_RELEASE_I(swapChainBackgroundPanelNative);
}
}
# endif // BX_PLATFORM_WINRT