Skip to content
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

Check for nil viewcontroller when removing observer #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

artonragsdale
Copy link

STPopup may lose its reference to view controller, especially after memory warning, causing bad access crash.
Checking for existence of view controller before removing observer prevents the crash

STPopup may lose its reference to view controller, especially after memory warning, causing bad access crash.
Checking for existence of view controller before removing observer prevents the crash
@kevin-lyn
Copy link
Owner

@artonragsdale _viewControllers in STPopupController holds strong reference of UIViewController, and it's not cleaned up when memory warning is received. Even it's set to nil, calling a function to nil will not crash. Do you have any crash log on this issue?

@artonragsdale
Copy link
Author

@kevin0571 I actually fixed this a while ago and just got around to submitting a pull request but it did solve a crash bug my app was experiencing. I'll have to look back through old crash reports to see if I can find it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants