mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-04-24 04:53:28 -04:00
D3D9: Fixed crash when Direct3DCreate9Ex fails to create interface.
This commit is contained in:
parent
8cd8328cd7
commit
44191da6dd
1 changed files with 11 additions and 8 deletions
|
@ -376,15 +376,18 @@ namespace bgfx { namespace d3d9
|
|||
&& NULL != Direct3DCreate9Ex)
|
||||
{
|
||||
Direct3DCreate9Ex(D3D_SDK_VERSION, &m_d3d9ex);
|
||||
HRESULT hr = m_d3d9ex->QueryInterface(IID_IDirect3D9, (void**)&m_d3d9);
|
||||
if (FAILED(hr) )
|
||||
if (NULL != m_d3d9ex)
|
||||
{
|
||||
BX_TRACE("Failed to query D3D9 interface 0x%08x.", hr);
|
||||
DX_RELEASE(m_d3d9ex, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pool = D3DPOOL_DEFAULT;
|
||||
HRESULT hr = m_d3d9ex->QueryInterface(IID_IDirect3D9, (void**)&m_d3d9);
|
||||
if (FAILED(hr) )
|
||||
{
|
||||
BX_TRACE("Failed to query D3D9 interface 0x%08x.", hr);
|
||||
DX_RELEASE(m_d3d9ex, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pool = D3DPOOL_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue