From 62010394ef9d88eedfc3e38c78aaac39e6b4cf2e Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 1 Mar 2025 15:17:30 -0800 Subject: [PATCH] Bug Fix: Remove observer cleanup Apparently, this isn't needed, and on two users reporting crashes, actually causes exceptions to be thrown somewhere. Signed-off-by: Christopher Snowhill --- Audio/Chain/ChunkList.h | 1 - Audio/Chain/ChunkList.m | 6 ------ 2 files changed, 7 deletions(-) diff --git a/Audio/Chain/ChunkList.h b/Audio/Chain/ChunkList.h index 8f24ec06a..34fea432a 100644 --- a/Audio/Chain/ChunkList.h +++ b/Audio/Chain/ChunkList.h @@ -40,7 +40,6 @@ NS_ASSUME_NONNULL_BEGIN #endif BOOL halveDSDVolume; - BOOL observersAdded; void *hdcd_decoder; diff --git a/Audio/Chain/ChunkList.m b/Audio/Chain/ChunkList.m index 52c59c4aa..04c4a27e6 100644 --- a/Audio/Chain/ChunkList.m +++ b/Audio/Chain/ChunkList.m @@ -402,8 +402,6 @@ static void convert_be_to_le(uint8_t *buffer, size_t bitsPerSample, size_t bytes halveDSDVolume = NO; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.halveDSDVolume" options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:kChunkListContext]; - - observersAdded = YES; } return self; @@ -431,10 +429,6 @@ static void convert_be_to_le(uint8_t *buffer, size_t bitsPerSample, size_t bytes if(tempData) { free(tempData); } - if(observersAdded) { - [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:@"values.halveDSDVolume" context:kChunkListContext]; - observersAdded = NO; - } } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {