From c8d8e759bc4ec0540c609d58ea3c0bfd5dd2b302 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 26 Feb 2022 23:30:18 -0800 Subject: [PATCH] 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 --- Audio/PluginController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Audio/PluginController.mm b/Audio/PluginController.mm index 1b52df1a4..a1867c9d8 100644 --- a/Audio/PluginController.mm +++ b/Audio/PluginController.mm @@ -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 lock(Cache_Lock); for(auto it = Cache_List.begin(); it != Cache_List.end();) { auto elapsed = std::chrono::duration_cast(now - it->second.time_accessed);