mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
fix memory leak
This commit is contained in:
1 file changed
+8
-2
@@ -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()
|
||||
}
|
||||
}
|
||||