From 5fa07999e7e88c4fd151a5c2a94f78651e585e95 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 13 Jul 2021 14:15:53 +1000 Subject: [PATCH] D3D12HostDisplay: Fix debug violation in DestroyRenderSurface() --- src/frontend-common/d3d12_host_display.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend-common/d3d12_host_display.cpp b/src/frontend-common/d3d12_host_display.cpp index 307b30893..2ace92f0d 100644 --- a/src/frontend-common/d3d12_host_display.cpp +++ b/src/frontend-common/d3d12_host_display.cpp @@ -458,6 +458,9 @@ bool D3D12HostDisplay::ChangeRenderWindow(const WindowInfo& new_wi) void D3D12HostDisplay::DestroyRenderSurface() { + // For some reason if we don't execute the command list here, the swap chain is in use.. not sure where. + g_d3d12_context->ExecuteCommandList(true); + if (IsFullscreen()) SetFullscreen(false, 0, 0, 0.0f);