Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Dealloc crash while using KVO #58

Open
obrhoff opened this issue Apr 6, 2015 · 8 comments
Open

Dealloc crash while using KVO #58

obrhoff opened this issue Apr 6, 2015 · 8 comments

Comments

@obrhoff
Copy link

obrhoff commented Apr 6, 2015

Sometimes Origiami Crashes because an KVO hasn't been unsubscribed while dealloc.

'NSInternalInconsistencyException', reason: 'An instance 0x7b875c40 of class ORGMInputUnit was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x78f1c020> (
<NSKeyValueObservance 0x78f1bfe0: Observer: 0x78f67c90, Key path: endOfInput, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x78ff3de0>
)'
*** First throw call stack:
(
    0   CoreFoundation                      0x01dd1466 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x04f5ca97 objc_exception_throw + 44
    2   CoreFoundation                      0x01dd138d +[NSException raise:format:] + 141
    3   Foundation                          0x04b88dd4 NSKVODeallocate + 379
    4   libobjc.A.dylib                     0x04f71772 _ZN11objc_object17sidetable_releaseEb + 248
    5   libobjc.A.dylib                     0x04f70e9b objc_release + 43
    6   libobjc.A.dylib                     0x04f59bd8 objc_setProperty_nonatomic + 48
    7   vinylify                            0x00293552 -[ORGMConverter setInputUnit:] + 66
    8   vinylify                            0x00292657 -[ORGMConverter dealloc] + 151
    9   libobjc.A.dylib                     0x04f71772 _ZN11objc_object17sidetable_releaseEb + 248
    10  libobjc.A.dylib                     0x04f70e9b objc_release + 43
    11  libobjc.A.dylib                     0x04f59bd8 objc_setProperty_nonatomic + 48
    12  vinylify                            0x00297092 -[ORGMOutputUnit setConverter:] + 66
    13  vinylify                            0x0029649e -[ORGMOutputUnit stop] + 78
    14  vinylify                            0x002961d7 -[ORGMOutputUnit dealloc] + 55
    15  libobjc.A.dylib                     0x04f71772 _ZN11objc_object17sidetable_releaseEb + 248
    16  libobjc.A.dylib                     0x04f70e9b objc_release + 43
    17  libobjc.A.dylib                     0x04f59bd8 objc_setProperty_nonatomic + 48
    18  vinylify                            0x00295232 -[ORGMEngine setOutput:] + 66
    19  vinylify                            0x00293de6 __42-[ORGMEngine playUrl:withOutputUnitClass:]_block_invoke + 950
    20  libdispatch.dylib                   0x05a825ea _dispatch_call_block_and_release + 15
    21  libdispatch.dylib                   0x05aa4bef _dispatch_client_callout + 14
    22  libdispatch.dylib                   0x05a88d61 _dispatch_queue_drain + 544
    23  libdispatch.dylib                   0x05a889cb _dispatch_queue_invoke + 212
    24  libdispatch.dylib                   0x05a8c012 _dispatch_root_queue_drain + 615
    25  libdispatch.dylib                   0x05a8db70 _dispatch_worker_thread3 + 115
    26  libsystem_pthread.dylib             0x05e001da _pthread_wqthread + 724
    27  libsystem_pthread.dylib             0x05dfde2e start_wqthread + 30
)
libc++abi.dylib: terminating with uncaught exception of type NSException```

@rperney
Copy link

rperney commented Apr 7, 2015

+1 same here

@daria-kopaliani
Copy link

+1

@ap4y
Copy link
Owner

ap4y commented Apr 20, 2015

I will try to look into it over the weekend.

@diogobalseiro
Copy link

+1

@diogobalseiro
Copy link

This commit may have fixed this: b504080

@freemanlam
Copy link

Tried add
[_input removeObserver:self forKeyPath:@"endOfInput"];
after
[self removeObserver:self forKeyPath:@"currentState"];
in ORGMEngine.m and works

@TiSsaa
Copy link

TiSsaa commented Apr 5, 2017

+1

@TiSsaa
Copy link

TiSsaa commented Apr 9, 2017

Resolved by adding:
[self.output release];
In class ORGMEngine at function - (void)playUrl:(NSURL *)url withOutputUnitClass:(Class)outputUnitClass:

ORGMOutputUnit *output = [[outputUnitClass alloc] initWithConverter:_converter];
output.outputFormat = _outputFormat;
[self.output release];
self.output = output;
[output release];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants