Fix Endless crashing.

This commit is contained in:
Glenn Maynard
2002-08-21 04:11:21 +00:00
parent 395fdbabbf
commit 755e1e44c3
+5 -1
View File
@@ -94,11 +94,15 @@ void Background::Unload()
{
for( int i=0; i<m_BackgroundAnimations.GetSize(); i++ )
delete m_BackgroundAnimations[i];
m_BackgroundAnimations.RemoveAll();
}
void Background::LoadFromSong( Song* pSong, bool bDisableVisualizations )
{
ASSERT( m_BackgroundAnimations.GetSize() == 0 ); // forgot to call Unload() after song end
/* Endless was crashing due to this; is there any reason not to
* fix it this way? -glenn */
Unload();
// ASSERT( m_BackgroundAnimations.GetSize() == 0 ); // forgot to call Unload() after song end
//
// figure out what BackgroundMode to use