Explain comment.

This commit is contained in:
Ottermandias 2023-08-23 18:42:12 +02:00
parent 3a8bf5dfa1
commit a6ae580b9f

View file

@ -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);
}