fix some stale StepsID entries hang around after unloading edits

This commit is contained in:
Chris Danford
2004-11-24 16:59:57 +00:00
parent 243d63094f
commit 0c55fd0684
3 changed files with 5 additions and 3 deletions
+3
View File
@@ -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 )
+1 -2
View File
@@ -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();
}
+1 -1
View File
@@ -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