From f413d3e412dc9bd68ddfb238b0fb868ecf4003a4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 25 Oct 2005 12:42:32 +0000 Subject: [PATCH] If a screen has no BG, we create a blank Actor without looking at g_vPreparedBackgrounds. Don't put them on there when we're done; they'll never be reused. --- stepmania/src/ScreenManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index c16365c292..b239373f23 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -674,8 +674,12 @@ void ScreenManager::LoadDelayedScreen() } ASSERT( pNewBGA != NULL ); - /* Move the background back to the prepared list. */ - g_vPreparedBackgrounds.push_back( g_pSharedBGA ); + /* Move the old background back to the prepared list, or delete it if + * it's a blank actor. */ + if( g_pSharedBGA->GetName() == "" ) + delete g_pSharedBGA; + else + g_vPreparedBackgrounds.push_back( g_pSharedBGA ); g_pSharedBGA = pNewBGA; g_pSharedBGA->PlayCommand( "On" ); }