mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix memory leak
(cherry picked from commit c178023779ed24a143a00dc5e4ecbec06afa5982)
This commit is contained in:
parent
c6eb97db02
commit
5642fc6346
@ -1952,17 +1952,17 @@ public final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTr
|
|||||||
videoNode.isUserInteractionEnabled = false
|
videoNode.isUserInteractionEnabled = false
|
||||||
var firstTime = true
|
var firstTime = true
|
||||||
videoNode.ownsContentNodeUpdated = { [weak self] owns in
|
videoNode.ownsContentNodeUpdated = { [weak self] owns in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self, let videoNode = strongSelf.videoNode {
|
||||||
if firstTime {
|
if firstTime {
|
||||||
firstTime = false
|
firstTime = false
|
||||||
if startFromSavedPosition, let videoTimestamp {
|
if startFromSavedPosition, let videoTimestamp {
|
||||||
videoNode.seek(Double(videoTimestamp))
|
videoNode.seek(Double(videoTimestamp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strongSelf.videoNode?.isHidden = !owns
|
videoNode.isHidden = !owns
|
||||||
if owns {
|
if owns {
|
||||||
strongSelf.videoNode?.setBaseRate(1.0)
|
videoNode.setBaseRate(1.0)
|
||||||
strongSelf.videoNode?.continuePlayingWithoutSound()
|
videoNode.continuePlayingWithoutSound()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user