Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Safely Remove Observer #11

Open
mattyohe opened this issue Apr 21, 2015 · 2 comments
Open

Safely Remove Observer #11

mattyohe opened this issue Apr 21, 2015 · 2 comments

Comments

@mattyohe
Copy link

Had an old version of your code in our app and there was a crasher due to over-removing the sessionVolumeKeyPath in dealloc. I'm not sure what scenario led to the observer not properly being added.

I would recommend wrapping this line:
https://github.com/jpsim/JPSVolumeButtonHandler/blob/master/JPSVolumeButtonHandler/JPSVolumeButtonHandler.m#L47

in an empty @Try so that this no longer crashes in odd scenarios.

@underscoretang
Copy link

hey @mattyohe did this ever get resolved for you?

@mattyohe
Copy link
Author

mattyohe commented Jul 2, 2015

@underscoretang Sure, I just did exactly what I said in the comment above. Is that not clear? Let me know.

mirceapasoi added a commit to alien-labs/JPSVolumeButtonHandler that referenced this issue Oct 13, 2015
jpsim added a commit that referenced this issue Oct 13, 2015
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

2 participants