STPopup
STPopup copied to clipboard
Check for nil viewcontroller when removing observer
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
@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?
@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.