From 00adaca32ec5b6bf221494f1267abaa01f39bb01 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 22 Aug 2023 15:18:59 +0200 Subject: [PATCH] Keep the texture alive during write. --- Penumbra/Import/Textures/TextureManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Penumbra/Import/Textures/TextureManager.cs b/Penumbra/Import/Textures/TextureManager.cs index 8c7ec609..f67dabb0 100644 --- a/Penumbra/Import/Textures/TextureManager.cs +++ b/Penumbra/Import/Textures/TextureManager.cs @@ -418,6 +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. + GC.KeepAlive(input); } private readonly struct ImageInputData