Core/MMaps: Fix dynamic mmap tile cache thread initialization

This commit is contained in:
Shauren
2026-01-08 13:06:44 +01:00
parent 38886d5f01
commit f3c88ea179

View File

@@ -163,13 +163,16 @@ struct TileCache
private:
void OnCacheCleanupTimerTick(boost::system::error_code const& error)
{
if (error || !_builderThread.joinable() /*shutting down*/)
return;
TimePoint now = GameTime::Now();
RemoveOldCacheEntries(now - CACHE_MAX_AGE);
_cacheCleanupTimer.expires_at(now + CACHE_CLEANUP_INTERVAL);
_cacheCleanupTimer.async_wait([this](boost::system::error_code const& error) { OnCacheCleanupTimerTick(error); });
_cacheCleanupTimer.async_wait([this](boost::system::error_code const& error)
{
if (error || !_builderThread.joinable() /*shutting down*/)
return;
OnCacheCleanupTimerTick(error);
});
}
void RemoveOldCacheEntries(TimePoint oldestPreservedEntryTimestamp)