diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index d7a4cda70b..172d0303f5 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -341,7 +341,13 @@ retry: CString sNewBGA = THEME->GetPathToB(sScreenName+" background"); if( m_sLastLoadedBackground != sNewBGA ) { - m_pSharedBGA->LoadFromAniDir( sNewBGA ); + // Create the new background before deleting the previous so that we keep + // any common textures loaded. + BGAnimation *pNewBGA = new BGAnimation; + pNewBGA->LoadFromAniDir( sNewBGA ); + SAFE_DELETE( m_pSharedBGA ); + m_pSharedBGA = pNewBGA; + m_sLastLoadedBackground = sNewBGA; }