Fix exit crash on Windows ARM64 with D3D11 (and probably also x64 Windows, but couldn't repro that)

This commit is contained in:
Henrik Rydgård
2025-06-09 17:19:50 +02:00
parent ea2046f6b8
commit b0ccfbfe5d
2 changed files with 14 additions and 0 deletions
+1
View File
@@ -335,6 +335,7 @@ void MainThreadFunc() {
g_graphicsContext->Shutdown();
delete g_graphicsContext;
g_graphicsContext = nullptr;
RECT rc;
if (console && GetWindowRect(console, &rc) && !IsIconic(console)) {
+13
View File
@@ -256,6 +256,19 @@ void D3D11Context::Shutdown() {
}
#endif
#ifdef _DEBUG
d3dDebug_ = nullptr;
d3dInfoQueue_ = nullptr;
#endif
// Important that we release before we unload the DLL, otherwise we may crash on shutdown.
bbRenderTargetTex_ = nullptr;
bbRenderTargetView_ = nullptr;
context1_ = nullptr;
context_ = nullptr;
device1_ = nullptr;
device_ = nullptr;
hWnd_ = nullptr;
UnloadD3D11();
}