GameList: Flush game list after re-scanning
Should hopefully fix random gamelist corruption.
This commit is contained in:
parent
25af5ef9d9
commit
194fc63232
|
@ -497,6 +497,14 @@ bool GameList::WriteEntryToCache(const GameListEntry* entry, ByteStream* stream)
|
|||
return result;
|
||||
}
|
||||
|
||||
void GameList::FlushCacheFileStream()
|
||||
{
|
||||
if (!m_cache_write_stream)
|
||||
return;
|
||||
|
||||
m_cache_write_stream->Flush();
|
||||
}
|
||||
|
||||
void GameList::CloseCacheFileStream()
|
||||
{
|
||||
if (!m_cache_write_stream)
|
||||
|
@ -588,6 +596,8 @@ void GameList::ScanDirectory(const char* path, bool recursive, ProgressCallback*
|
|||
entry = {};
|
||||
}
|
||||
|
||||
FlushCacheFileStream();
|
||||
|
||||
progress->SetProgressValue(static_cast<u32>(files.size()));
|
||||
progress->PopState();
|
||||
}
|
||||
|
|
|
@ -107,6 +107,7 @@ private:
|
|||
bool LoadEntriesFromCache(ByteStream* stream);
|
||||
bool OpenCacheForWriting();
|
||||
bool WriteEntryToCache(const GameListEntry* entry, ByteStream* stream);
|
||||
void FlushCacheFileStream();
|
||||
void CloseCacheFileStream();
|
||||
void DeleteCacheFile();
|
||||
|
||||
|
|
Loading…
Reference in New Issue