From 0ed4c9863eb8862610cf7cc86b20fcf069d5ee09 Mon Sep 17 00:00:00 2001 From: erri120 Date: Wed, 9 Oct 2019 19:20:17 +0200 Subject: [PATCH] Slight memory usage optimization --- Wabbajack/AppState.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index f952a01e..6029eac8 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -409,7 +409,11 @@ namespace Wabbajack if (_cachedSlides.ContainsKey(randomElement.ModID)) { + var bitmap = new BitmapImage(); + _cachedSlides.TryGetValue(randomElement.ModID, out bitmap); + bitmap = null; _cachedSlides.Remove(randomElement.ModID); + //hmmm //GC.Collect(); } } while (_cachedSlides.Count >= MAX_CACHE_SIZE);