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

UITableView.delegate 开启了 qmui_multipleDelegatesEnabled 后在 dealloc 时可能引发 crash #1411

Closed
MoLice opened this issue Jun 20, 2022 · 2 comments
Labels

Comments

@MoLice
Copy link
Collaborator

MoLice commented Jun 20, 2022

Bug 表现
tableViewController 在 dealloc 后可能出现 UITableView dataSource returned a nil cell for row at index path 的异常。

其他信息

  • 设备: All
  • QMUI 版本: [4.4.3]
@MoLice MoLice added the bug label Jun 20, 2022
@MoLice
Copy link
Collaborator Author

MoLice commented Jun 20, 2022

image

开启 qmui_multipleDelegatesEnabled 的对象,即便执行了 obj.delegate = nil,实际上并不会真的把 delegate 置空,而是把 QMUIMultipleDelegates 容器里的对象都清空,但 obj.delegate 依然是指向 QMUIMultipleDelegates 对象。这就会导致当 - [UITableViewController dealloc] 时把 tableView.delegate = nil 后,由于某些原因 tableView 又试图去访问 delegate,就会因为 delegates 被清空,导致 tableView:cellForRowAtIndexPath: 返回一个 nil 的结果,命中系统的 assert。

@MoLice
Copy link
Collaborator Author

MoLice commented Aug 10, 2022

已发布 4.5.0 修复该问题。

@MoLice MoLice closed this as completed Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant