Examples: SDL2+DX11, SDL3+DX11, Win32+DX10, Win32+DX11: fixed one resource leak. (#9010, #4350)

This commit is contained in:
ocornut
2025-10-16 13:48:24 +02:00
parent e1b27ce51e
commit aa9f6db698
5 changed files with 22 additions and 0 deletions

View File

@@ -256,7 +256,10 @@ bool CreateDeviceD3D(HWND hWnd)
// - This must be done for all windows associated to the device. Our DX11 backend does this automatically for secondary viewports that it creates.
IDXGIFactory* pSwapChainFactory;
if (SUCCEEDED(g_pSwapChain->GetParent(IID_PPV_ARGS(&pSwapChainFactory))))
{
pSwapChainFactory->MakeWindowAssociation(hWnd, DXGI_MWA_NO_ALT_ENTER);
pSwapChainFactory->Release();
}
CreateRenderTarget();
return true;