From 8b17dac094c3c1176845634915d3304756a93bde Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 8 Jan 2003 06:51:54 +0000 Subject: [PATCH] fix crash on texture leak --- stepmania/src/FontManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stepmania/src/FontManager.cpp b/stepmania/src/FontManager.cpp index c21a9aae6d..133d852a5c 100644 --- a/stepmania/src/FontManager.cpp +++ b/stepmania/src/FontManager.cpp @@ -32,12 +32,17 @@ FontManager::FontManager() FontManager::~FontManager() { + /* It's not safe to delete fonts that still have references left, because fonts + * will also release other fonts when they're deleted (we'd have to make sure + * to delete top-level fonts first). Since this should never happen anyway, + * and we only delete FontManager when we're shutting down, let's just warn + * about font leaks and not actually free them. */ for( std::map::iterator i = m_mapPathToFont.begin(); i != m_mapPathToFont.end(); ++i) { Font* pFont = i->second; LOG->Trace( "FONT LEAK: '%s', RefCount = %d.", i->first.GetString(), pFont->m_iRefCount ); - delete pFont; +// delete pFont; } }