From 311ca3c3f1719c0effeedfb8cf90d9f2675ef8a5 Mon Sep 17 00:00:00 2001 From: jhorv <38920027+jhorv@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:47:47 -0400 Subject: fix: for pooled memory used for reference types, clear it on return to the pool so that it doesn't prevent GC of the instances it contained (#6937) --- src/Ryujinx.Common/Memory/SpanOwner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Ryujinx.Common/Memory/SpanOwner.cs') diff --git a/src/Ryujinx.Common/Memory/SpanOwner.cs b/src/Ryujinx.Common/Memory/SpanOwner.cs index a4b4adf3..acb20bca 100644 --- a/src/Ryujinx.Common/Memory/SpanOwner.cs +++ b/src/Ryujinx.Common/Memory/SpanOwner.cs @@ -108,7 +108,7 @@ namespace Ryujinx.Common.Memory [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Dispose() { - ArrayPool.Shared.Return(_array); + ArrayPool.Shared.Return(_array, RuntimeHelpers.IsReferenceOrContainsReferences()); } } } -- cgit v1.2.3