Fix memory leaks in core components

commit_hash:1f841204f9d5484c75e3f92c9a1faa0e127a58de
This commit is contained in:
nshapovalov01
2026-05-26 14:43:28 +03:00
parent 7e675c6cb1
commit ebf720f789
3 changed files with 10 additions and 2 deletions
@@ -143,6 +143,10 @@ final class ValueAnimator<I: ValueInterpolator>: Animator {
isRunning = true
}
deinit {
if isRunning { stop() }
}
func stop() {
item?.cancel()
item = nil
@@ -133,8 +133,12 @@ public final class DivViewPreloader {
}
}
func reset(cardId: DivCardID) {
public func reset(cardId: DivCardID) {
blockProviders.removeValue(forKey: cardId)
}
public func resetAll() {
blockProviders.removeAll()
}
}
#endif
@@ -7,7 +7,7 @@ final class TabContentsView: BlockView {
static let animationDuration: TimeInterval = 0.2
}
var delegate: TabContentsViewDelegate?
weak var delegate: TabContentsViewDelegate?
weak var updatesDelegate: TabbedPagesViewModelDelegate?
private(set) var selectedPageIndex: CGFloat = 0
private(set) var model: TabContentsViewModel!