-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes related to KVO and UserDefaults #161
Comments
Which |
@sindresorhus We are using 7.3 in the latest production, and use the |
The crash happens in Apple's code that notifies about KVO, not the code that subscribes to KVO, so this really seems like UserDefaults itself is accidentally not fully thread-safe. |
Without a way to reproduce the issue locally, I cannot really come up with a workaround. Defaults cannot wrap calls to UserDefaulta in |
I also have not seen this kind of crash in any of my 40 apps (almost all of them use |
You could try this: eef0df0 But it could cause problems if the value is read right after. |
Thanks a lot. I've moved to this branch and will report bck after the next update. |
Since using this library, we are seeing some crash reports which look related to KVO and UserDefaults. We haven't been able to reproduce them but are seeing crash reports on all iOS versions (although more on iOS 15).
Has anyone seen something similar or any pointers on how to fix this (happy to submit a PR)?
Here are some ideas/observations/infos:
The text was updated successfully, but these errors were encountered: