From a6ae580b9f23f7f43acf3637b866435616929396 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Wed, 23 Aug 2023 18:42:12 +0200 Subject: [PATCH] Explain comment. --- Penumbra/Import/Textures/TextureManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Penumbra/Import/Textures/TextureManager.cs b/Penumbra/Import/Textures/TextureManager.cs index f67dabb0..9e4890f2 100644 --- a/Penumbra/Import/Textures/TextureManager.cs +++ b/Penumbra/Import/Textures/TextureManager.cs @@ -418,7 +418,8 @@ public sealed class TextureManager : SingleTaskQueue, IDisposable using var w = new BinaryWriter(stream); header.Write(w); w.Write(input.Pixels); - // No idea why this is necessary, but it is. + // Necessary due to the GC being allowed to collect after the last invocation of an object, + // thus invalidating the ReadOnlySpan. GC.KeepAlive(input); }