Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash in SSLabel dealloc when there are no registered observers.
The dealloc method attempts to remove the observers added in the initWithFrame method but if the initWithFrame has not been called such as when using a SSLabel in a view without a parent in a XIB then it crashes with an exception but it is not allowed to remove an observer than hasn't been added. This fix does a simple check to see if there are any registered observers before attempting to remove them.
- Loading branch information
cabe99f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh clever. I don't use IB so I never experience these types of bugs. I'll go through everything and try to prevent this in all of my views. Good catch!
cabe99f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!