Skip to content

Commit 5642fc6

Browse files
author
Isaac
committed
Fix memory leak
(cherry picked from commit c178023)
1 parent c6eb97d commit 5642fc6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

submodules/TelegramUI/Components/Chat/ChatMessageInteractiveMediaNode/Sources/ChatMessageInteractiveMediaNode.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,17 +1952,17 @@ public final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTr
19521952
videoNode.isUserInteractionEnabled = false
19531953
var firstTime = true
19541954
videoNode.ownsContentNodeUpdated = { [weak self] owns in
1955-
if let strongSelf = self {
1955+
if let strongSelf = self, let videoNode = strongSelf.videoNode {
19561956
if firstTime {
19571957
firstTime = false
19581958
if startFromSavedPosition, let videoTimestamp {
19591959
videoNode.seek(Double(videoTimestamp))
19601960
}
19611961
}
1962-
strongSelf.videoNode?.isHidden = !owns
1962+
videoNode.isHidden = !owns
19631963
if owns {
1964-
strongSelf.videoNode?.setBaseRate(1.0)
1965-
strongSelf.videoNode?.continuePlayingWithoutSound()
1964+
videoNode.setBaseRate(1.0)
1965+
videoNode.continuePlayingWithoutSound()
19661966
}
19671967
}
19681968
}

0 commit comments

Comments
 (0)