fix memory leak

This commit is contained in:
neon443 committed 2026-04-11 00:25:19 +01:00
1 parent 6bcef5c8dd
commit 5579ff9085
1 file changed
+8 -2
+8 -2
View File
@@ -18,7 +18,7 @@ class EmojiCell: UITableViewCell {
spinner.startAnimating()
spinner.frame = frame
addSubview(spinner)
contentView.addSubview(spinner)
spinner.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
@@ -55,7 +55,13 @@ class EmojiCell: UITableViewCell {
}
override func prepareForReuse() {
spinner.removeFromSuperview()
super.prepareForReuse()
hostingController?.view.removeFromSuperview()
hostingController = nil
if spinner.superview == nil {
contentView.addSubview(spinner)
}
spinner.startAnimating()
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.