From 7af86d63bc70d2afbd3df85c03cfc1a335afa338 Mon Sep 17 00:00:00 2001 From: Dreitone Date: Fri, 19 Dec 2025 19:03:32 -0600 Subject: [PATCH] cherry-pick: fix unloading --- Graphics/Primitives/PrimitiveRenderer.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Graphics/Primitives/PrimitiveRenderer.cs b/Graphics/Primitives/PrimitiveRenderer.cs index cde72d2990..8c9a78f382 100644 --- a/Graphics/Primitives/PrimitiveRenderer.cs +++ b/Graphics/Primitives/PrimitiveRenderer.cs @@ -100,6 +100,18 @@ namespace CalamityMod.Graphics.Primitives { Main.QueueMainThreadAction(() => { + MainPositions = null; + MainVertices = null; + MainIndices = null; + MainCompletionRatios = null; + MainTangents = null; + MainNormals = null; + WireframeVertices = null; + NonSmoothIndexScratch = null; + VertexBuffer?.Dispose(); + VertexBuffer = null; + IndexBuffer?.Dispose(); + IndexBuffer = null; WireframeEffect?.Dispose(); WireframeEffect = null; });