forked from shadowfacts/Tusker
Fix potential crash during gifv playback
I don't know how this is possible, but it evidently is
This commit is contained in:
parent
351efe4b58
commit
a5066140fd
|
@ -208,9 +208,9 @@ private class PlayerView: UIView {
|
||||||
playerLayer.player = player
|
playerLayer.player = player
|
||||||
playerLayer.videoGravity = .resizeAspect
|
playerLayer.videoGravity = .resizeAspect
|
||||||
|
|
||||||
presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [unowned self] _, _ in
|
presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [weak self] _, _ in
|
||||||
MainActor.assumeIsolated {
|
MainActor.assumeIsolated {
|
||||||
self.invalidateIntrinsicContentSize()
|
self?.invalidateIntrinsicContentSize()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,9 +60,9 @@ class GifvController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func updatePresentationSizeObservation() {
|
private func updatePresentationSizeObservation() {
|
||||||
presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [unowned self] item, _ in
|
presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [weak self] item, _ in
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.presentationSizeSubject.send(item.presentationSize)
|
self?.presentationSizeSubject.send(item.presentationSize)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue