Force immediate destruction of the D3D11 swapchain

Possible fix for #959
This commit is contained in:
Cameron Gutman 2023-08-03 19:18:07 -05:00
parent d147d36867
commit dc5414bd0d

View file

@ -141,6 +141,12 @@ D3D11VARenderer::~D3D11VARenderer()
av_buffer_unref(&m_HwFramesContext);
}
// Force destruction of the swapchain immediately
if (m_DeviceContext != nullptr) {
m_DeviceContext->ClearState();
m_DeviceContext->Flush();
}
if (m_HwDeviceContext != nullptr) {
// This will release m_Device and m_DeviceContext too
av_buffer_unref(&m_HwDeviceContext);