mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
Fixed ressource leaks.
This commit is contained in:
parent
c99628a88a
commit
8757f4a548
3 changed files with 12 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue