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 <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-03-01 15:17:30 -08:00
parent b8580cf193
commit 62010394ef
2 changed files with 0 additions and 7 deletions

View file

@ -40,7 +40,6 @@ NS_ASSUME_NONNULL_BEGIN
#endif #endif
BOOL halveDSDVolume; BOOL halveDSDVolume;
BOOL observersAdded;
void *hdcd_decoder; void *hdcd_decoder;

View file

@ -402,8 +402,6 @@ static void convert_be_to_le(uint8_t *buffer, size_t bitsPerSample, size_t bytes
halveDSDVolume = NO; halveDSDVolume = NO;
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.halveDSDVolume" options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:kChunkListContext]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.halveDSDVolume" options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:kChunkListContext];
observersAdded = YES;
} }
return self; return self;
@ -431,10 +429,6 @@ static void convert_be_to_le(uint8_t *buffer, size_t bitsPerSample, size_t bytes
if(tempData) { if(tempData) {
free(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 { - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {