From 4f4d2dbf42acb00edc7e83c04664d598d0711ee7 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 6 Oct 2020 22:32:10 +1100 Subject: [PATCH] [host] dxgi: fix memory leak if an error occurs --- host/platform/Windows/capture/DXGI/src/dxgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/platform/Windows/capture/DXGI/src/dxgi.c b/host/platform/Windows/capture/DXGI/src/dxgi.c index 59d0b62e..322d6aff 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/host/platform/Windows/capture/DXGI/src/dxgi.c @@ -758,6 +758,8 @@ static CaptureResult dxgi_capture() } } + IDXGIResource_Release(res); + // if the pointer shape has changed uint32_t bufferSize; if (frameInfo.PointerShapeBufferSize > 0) @@ -854,8 +856,6 @@ static CaptureResult dxgi_capture() } } - IDXGIResource_Release(res); - if (frameInfo.LastMouseUpdateTime.QuadPart) { /* the pointer position is only valid if the pointer is visible */