Skip to content

Commit 33bd994

Browse files
committed
D3D12: Avoid crash on exit
1 parent 3978628 commit 33bd994

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/d3d12/rendering_context_driver_d3d12.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ const GUID CLSID_D3D12SDKConfigurationGodot = { 0x7cda6aca, 0xa03e, 0x49c8, { 0x
8585
RenderingContextDriverD3D12::RenderingContextDriverD3D12() {}
8686

8787
RenderingContextDriverD3D12::~RenderingContextDriverD3D12() {
88+
// Let's release manually everything that may still be holding
89+
// onto the DLLs before freeing them.
90+
device_factory.Reset();
91+
dxgi_factory.Reset();
92+
8893
if (lib_d3d12) {
8994
FreeLibrary(lib_d3d12);
9095
}

0 commit comments

Comments
 (0)