SONGMAN->Cleanup only in the Prepare code path. There's no point to doing it in the AddNewScreenToTop path.
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user