SONGMAN->Cleanup only in the Prepare code path. There's no point to doing it in the AddNewScreenToTop path.

This commit is contained in:
Glenn Maynard
2005-07-19 23:30:24 +00:00
parent de950a3190
commit 509055d9f7
+4 -4
View File
@@ -318,10 +318,6 @@ Screen* ScreenManager::MakeNewScreenInternal( const CString &sScreenName )
Screen* ScreenManager::MakeNewScreen( const CString &sScreenName )
{
/* Cleanup song data. This can free up a fair bit of memory, so do it before
* creating the new screen, to lower peak memory usage slightly. */
SONGMAN->Cleanup();
Screen* ret = MakeNewScreenInternal( sScreenName );
return ret;
@@ -337,6 +333,10 @@ void ScreenManager::PrepareScreen( const CString &sScreenName )
return;
}
/* Cleanup song data. This can free up a fair bit of memory, so do it before
* creating the new screen, to lower peak memory usage slightly. */
SONGMAN->Cleanup();
Screen* pNewScreen = MakeNewScreen(sScreenName);
m_vPreparedScreens.push_back( pNewScreen );