diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index 76ea8e7a8..d8aadd1a1 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -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(files.size())); progress->PopState(); } diff --git a/src/core/game_list.h b/src/core/game_list.h index 1ea03a5cc..c85915200 100644 --- a/src/core/game_list.h +++ b/src/core/game_list.h @@ -107,6 +107,7 @@ private: bool LoadEntriesFromCache(ByteStream* stream); bool OpenCacheForWriting(); bool WriteEntryToCache(const GameListEntry* entry, ByteStream* stream); + void FlushCacheFileStream(); void CloseCacheFileStream(); void DeleteCacheFile();