From 9ca577e0dadc280bd6bd026f5290ebc5c1a87ad5 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Thu, 2 May 2013 00:05:57 +0200 Subject: [PATCH] Unloading textures does not work in GC thread (yet) --- Vocaluxe/Base/Fonts/CFont.cs | 4 ++-- Vocaluxe/Base/Fonts/CFonts.cs | 3 --- Vocaluxe/Base/Fonts/CGlyph.cs | 2 +- Vocaluxe/Screens/CScreenTest.cs | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Vocaluxe/Base/Fonts/CFont.cs b/Vocaluxe/Base/Fonts/CFont.cs index fc6004f9..70232953 100644 --- a/Vocaluxe/Base/Fonts/CFont.cs +++ b/Vocaluxe/Base/Fonts/CFont.cs @@ -128,8 +128,8 @@ namespace Vocaluxe.Base.Fonts public void UnloadGlyphs() { - //foreach (CGlyph glyph in _Glyphs.Values) - // glyph.UnloadTexture(); + foreach (CGlyph glyph in _Glyphs.Values) + glyph.UnloadTexture(); _Glyphs.Clear(); } diff --git a/Vocaluxe/Base/Fonts/CFonts.cs b/Vocaluxe/Base/Fonts/CFonts.cs index 99c271a8..067cabd1 100644 --- a/Vocaluxe/Base/Fonts/CFonts.cs +++ b/Vocaluxe/Base/Fonts/CFonts.cs @@ -418,9 +418,6 @@ namespace Vocaluxe.Base.Fonts public static void UnloadThemeFonts(string themeName) { - if (_Fonts.Count == 0) - return; - int index = 0; while (index < _Fonts.Count) { diff --git a/Vocaluxe/Base/Fonts/CGlyph.cs b/Vocaluxe/Base/Fonts/CGlyph.cs index ea0f1e18..a24551fa 100644 --- a/Vocaluxe/Base/Fonts/CGlyph.cs +++ b/Vocaluxe/Base/Fonts/CGlyph.cs @@ -128,7 +128,7 @@ namespace Vocaluxe.Base.Fonts CFonts.Height = oldHeight; } - ~CGlyph() + public void UnloadTexture() { CDraw.RemoveTexture(ref _Texture); } diff --git a/Vocaluxe/Screens/CScreenTest.cs b/Vocaluxe/Screens/CScreenTest.cs index 4a84b29c..d7b3b722 100644 --- a/Vocaluxe/Screens/CScreenTest.cs +++ b/Vocaluxe/Screens/CScreenTest.cs @@ -20,7 +20,6 @@ using System; using System.Windows.Forms; using Vocaluxe.Base; -using Vocaluxe.Base.Fonts; using VocaluxeLib.Menu; namespace Vocaluxe.Screens