Fixed ressource leaks.

This commit is contained in:
Nemirtingas 2019-08-19 19:51:35 +02:00
parent c99628a88a
commit 8757f4a548
3 changed files with 12 additions and 5 deletions

View file

@ -89,7 +89,7 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
if (!initialized)
{
if (FAILED(pSwapChain->GetDevice(__uuidof(ID3D10Device), (PVOID*)& pDevice)))
if (FAILED(pSwapChain->GetDevice(IID_PPV_ARGS(&pDevice))))
return;
ImGui::CreateContext();
@ -98,12 +98,14 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
ID3D10Texture2D* pBackBuffer;
pSwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*)& pBackBuffer);
pSwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer));
pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView);
pBackBuffer->Release();
ImGui_ImplDX10_Init(pDevice);
pDevice->Release();
initialized = true;
}