fix some stale StepsID entries hang around after unloading edits
This commit is contained in:
@@ -1225,6 +1225,9 @@ void SongManager::FreeAllLoadedFromProfiles()
|
|||||||
Song* pSong = m_pSongs[s];
|
Song* pSong = m_pSongs[s];
|
||||||
pSong->FreeAllLoadedFromProfiles();
|
pSong->FreeAllLoadedFromProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// After freeing some Steps pointers, the cache will be invalid.
|
||||||
|
SongID::ClearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CheckPointer( const Song *p )
|
static bool CheckPointer( const Song *p )
|
||||||
|
|||||||
@@ -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();
|
g_Cache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
CString ToString() const;
|
CString ToString() const;
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
static void Invalidate( Song *pStaleSong );
|
static void ClearCache();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user