From 91da112e352e0afdd32e048e316acdc1c04f93c0 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 7 Feb 2022 15:31:57 -0800 Subject: [PATCH] Cog Audio: Fix potential hang on stop The ChunkList wasn't clearing the remover entered flag when the chain was empty. Now it does, so it will shut down correctly. Signed-off-by: Christopher Snowhill --- Audio/Chain/ChunkList.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Audio/Chain/ChunkList.m b/Audio/Chain/ChunkList.m index ce9f91217..63288817e 100644 --- a/Audio/Chain/ChunkList.m +++ b/Audio/Chain/ChunkList.m @@ -74,8 +74,10 @@ @synchronized(chunkList) { inRemover = YES; - if(![chunkList count]) + if(![chunkList count]) { + inRemover = NO; return [[AudioChunk alloc] init]; + } AudioChunk *chunk = [chunkList objectAtIndex:0]; if([chunk frameCount] <= maxFrameCount) { [chunkList removeObjectAtIndex:0];