From 745f23a3a1b8d2fb18a32727c6f5bd2135fee29e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 28 May 2022 13:48:59 +0200 Subject: [PATCH] Add missing ArrayPool.Return-s in D2D1ShaderCompiler --- .../Shaders/Interop/D2D1ShaderCompiler.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs index ac459e8b..8e3f9ae9 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs @@ -44,7 +44,12 @@ public static class D2D1ShaderCompiler ReadOnlySpan sourceAscii = sourceBuffer.AsSpan(0, sourceWrittenBytes); ReadOnlySpan entryPointAscii = entryPointBuffer.AsSpan(0, entryPointWrittenBytes); - return Compile(sourceAscii, entryPointAscii, shaderProfile, options); + ReadOnlyMemory bytecode = Compile(sourceAscii, entryPointAscii, shaderProfile, options); + + ArrayPool.Shared.Return(sourceBuffer); + ArrayPool.Shared.Return(entryPointBuffer); + + return bytecode; } ///