Add autoreleasepool to cache thread

The cache thread should have an autoreleasepool around the release loop,
because it will be freeing Objective C objects periodically.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-26 23:30:18 -08:00
parent da4630f4c5
commit c8d8e759bc
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ static void cache_run() {
while(Cache_Running) {
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
{
@autoreleasepool {
std::lock_guard<std::mutex> lock(Cache_Lock);
for(auto it = Cache_List.begin(); it != Cache_List.end();) {
auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(now - it->second.time_accessed);