fix crash on exiting editor
clean up invalidation of Song and Courses
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user