fix(ios): message sent to deallocated instance #1482
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide an example of how to test the change
I had some
EXC_BAD_ACCESS
crashes in my app without an useful stack trace. After enabling zombie mode I was able to get the following log:I checked the code and eventually figured out that
[_player removeObserver:self forKeyPath:externalPlaybackActive context: nil];
is not called upon dealloc.I am not 100% sure this results in the crash. However after adding that line to dealloc I was not able to reproduce this issue with the simulator or my testing device. I will also send out a new testflight in order to verify that this is the case.
The crash seems to occur when you are quickly mounting and unmount video components e.g. through quick navigation.