mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-15 05:42:28 +00:00
Fix WARP device leak
This commit is contained in:
parent
f732b1978e
commit
a1c350a537
1 changed files with 4 additions and 0 deletions
|
@ -182,11 +182,13 @@ bool D3D11VARenderer::createDeviceByAdapterIndex(int adapterIndex, bool* indexWa
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"IDXGIAdapter::GetDesc() failed: %x",
|
"IDXGIAdapter::GetDesc() failed: %x",
|
||||||
hr);
|
hr);
|
||||||
|
adapter->Release();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adapterDesc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) {
|
if (adapterDesc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) {
|
||||||
// Skip the WARP device
|
// Skip the WARP device
|
||||||
|
adapter->Release();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,6 +285,8 @@ bool D3D11VARenderer::initialize(PDECODER_PARAMETERS params)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invalidIndex) {
|
if (invalidIndex) {
|
||||||
|
SDL_assert(m_Device == nullptr);
|
||||||
|
SDL_assert(m_DeviceContext == nullptr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue