From a8803f97778dd7978d4ad8c76216720ea83c9501 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 23 Apr 2005 06:19:36 +0000 Subject: [PATCH] fix background caching --- stepmania/src/ScreenSelectMusic.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 10e7935cc0..040af1302c 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -729,6 +729,7 @@ void ScreenSelectMusic::CheckBackgroundRequests() return; CString sPath; + bool bFreeCache = false; if( TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) ) { /* If the file is already loaded into a texture, it's finished, @@ -739,11 +740,14 @@ void ScreenSelectMusic::CheckBackgroundRequests() { if( !m_BackgroundLoader.IsCacheFileFinished( g_sBannerPath, sPath ) ) return; - m_BackgroundLoader.FinishedWithCachedFile( g_sBannerPath ); + bFreeCache = true; } g_bBannerWaiting = false; m_Banner.Load( sPath ); + + if( bFreeCache ) + m_BackgroundLoader.FinishedWithCachedFile( g_sBannerPath ); } /* Nothing else is going. Start the music, if we havn't yet. */