Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nil out tableView delegate on dealloc
If tableView is scrolling as this VC is being dealloc'd it continues to send messages (scrollViewDidScroll:) to its delegate. This is fine if the delegate will outlive tableView (e.g. this VC would.) However, if the delegate is an instance that may be dealloc'd before the tableView (i.e. _scrollProxy may be dealloc'd prior to tableView being dealloc'd) the tableView will send messages to its delegate, which is defined with an "assign" (i.e. unsafe_unretained) property. This is a msgSend to non-nil'ed, invalid memory leading to a crash. If or when UIScrollView's delegate is referred to with "weak" rather than "assign", this can and should be removed.
- Loading branch information