diff --git a/Packages/GalleryVC/Sources/GalleryVC/Content/VideoGalleryContentViewController.swift b/Packages/GalleryVC/Sources/GalleryVC/Content/VideoGalleryContentViewController.swift index 09f2751dc..4afa609d3 100644 --- a/Packages/GalleryVC/Sources/GalleryVC/Content/VideoGalleryContentViewController.swift +++ b/Packages/GalleryVC/Sources/GalleryVC/Content/VideoGalleryContentViewController.swift @@ -208,9 +208,9 @@ private class PlayerView: UIView { playerLayer.player = player playerLayer.videoGravity = .resizeAspect - presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [unowned self] _, _ in + presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [weak self] _, _ in MainActor.assumeIsolated { - self.invalidateIntrinsicContentSize() + self?.invalidateIntrinsicContentSize() } }) } diff --git a/Tusker/Views/Attachments/GifvController.swift b/Tusker/Views/Attachments/GifvController.swift index b89bd2d51..d7992466a 100644 --- a/Tusker/Views/Attachments/GifvController.swift +++ b/Tusker/Views/Attachments/GifvController.swift @@ -60,9 +60,9 @@ class GifvController { } private func updatePresentationSizeObservation() { - presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [unowned self] item, _ in + presentationSizeObservation = item.observe(\.presentationSize, changeHandler: { [weak self] item, _ in DispatchQueue.main.async { - self.presentationSizeSubject.send(item.presentationSize) + self?.presentationSizeSubject.send(item.presentationSize) } }) }