diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 8a4fd68318..6c591981da 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -1225,6 +1225,9 @@ void SongManager::FreeAllLoadedFromProfiles() Song* pSong = m_pSongs[s]; pSong->FreeAllLoadedFromProfiles(); } + + // After freeing some Steps pointers, the cache will be invalid. + SongID::ClearCache(); } static bool CheckPointer( const Song *p ) diff --git a/stepmania/src/StepsUtil.cpp b/stepmania/src/StepsUtil.cpp index ced7cc6f77..941fa86a59 100644 --- a/stepmania/src/StepsUtil.cpp +++ b/stepmania/src/StepsUtil.cpp @@ -195,9 +195,8 @@ XNode* StepsID::CreateNode() const } -void StepsID::Invalidate( Song *pStaleSong ) +void StepsID::ClearCache() { - // FIXME: Only flush entries with the stale song g_Cache.clear(); } diff --git a/stepmania/src/StepsUtil.h b/stepmania/src/StepsUtil.h index 8ef119e5a3..1ea2836470 100644 --- a/stepmania/src/StepsUtil.h +++ b/stepmania/src/StepsUtil.h @@ -39,7 +39,7 @@ public: void LoadFromNode( const XNode* pNode ); CString ToString() const; bool IsValid() const; - static void Invalidate( Song *pStaleSong ); + static void ClearCache(); }; #endif