Skip to content

Check for nil viewcontroller when removing observer#75

Open
artonragsdale wants to merge 1 commit into
kevin-lyn:masterfrom
InkCorp:fix/destroyObserversCrash
Open

Check for nil viewcontroller when removing observer#75
artonragsdale wants to merge 1 commit into
kevin-lyn:masterfrom
InkCorp:fix/destroyObserversCrash

Conversation

@artonragsdale

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

2 participants