Skip to content

Commit

Permalink
D3D12: Avoid crash on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Aug 2, 2024
1 parent 3978628 commit 33bd994
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/d3d12/rendering_context_driver_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ const GUID CLSID_D3D12SDKConfigurationGodot = { 0x7cda6aca, 0xa03e, 0x49c8, { 0x
RenderingContextDriverD3D12::RenderingContextDriverD3D12() {}

RenderingContextDriverD3D12::~RenderingContextDriverD3D12() {
// Let's release manually everything that may still be holding
// onto the DLLs before freeing them.
device_factory.Reset();
dxgi_factory.Reset();

if (lib_d3d12) {
FreeLibrary(lib_d3d12);
}
Expand Down

0 comments on commit 33bd994

Please sign in to comment.