From 456a687969269b7b3ba57eba9930ab16b33ecfda Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 22 Feb 2021 21:35:39 +0100 Subject: [PATCH] Fixed a memory leak in the swap chain render loop --- samples/ComputeSharp.Sample.SwapChain/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/ComputeSharp.Sample.SwapChain/Program.cs b/samples/ComputeSharp.Sample.SwapChain/Program.cs index 04f4b087..97f112a9 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Program.cs +++ b/samples/ComputeSharp.Sample.SwapChain/Program.cs @@ -207,7 +207,8 @@ namespace ComputeSharp.Sample.SwapChain this.currentBufferIndex ^= 1; - // Reset the command list to reuse + // Reset the command list and command allocator + this.d3D12CommandAllocator.Get()->Reset(); this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null); D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[]