fix crash on exiting editor

clean up invalidation of Song and Courses
This commit is contained in:
Chris Danford
2004-08-12 04:49:15 +00:00
parent cbe80105fb
commit 873c148f0e
7 changed files with 35 additions and 22 deletions
+7 -3
View File
@@ -671,10 +671,14 @@ void SongManager::Cleanup()
* pointers, which are updated explicitly in Song::RevertFromDisk. */
void SongManager::Invalidate( Song *pStaleSong )
{
/* Erase cached course info. */
FOREACH_CONST( Course*, m_pCourses, c )
(*c)->Invalidate( pStaleSong );
// It's a real pain to selectively invalidate only those Courses with
// dependencies on the stale Song. So, instead, just reload all Courses.
// It doesn't take very long.
FreeCourses();
InitCoursesFromDisk( NULL );
InitAutogenCourses();
// invalidate cache
StepsID::Invalidate( pStaleSong );
}