From 82b844888c644687d54197a77c212cb11af6d118 Mon Sep 17 00:00:00 2001 From: wade-hawk Date: Tue, 1 Oct 2019 00:52:22 +0900 Subject: [PATCH] Bug fixed #221 fixed livePhotos memory leak --- TLPhotoPicker.podspec | 2 +- TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/TLPhotoPicker.podspec b/TLPhotoPicker.podspec index 39d4dc12..7dfd05a3 100644 --- a/TLPhotoPicker.podspec +++ b/TLPhotoPicker.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'TLPhotoPicker' - s.version = '2.0.1' + s.version = '2.0.4' s.summary = 'multiple phassets picker for iOS lib. like facebook' # This description is used to generate tags and improve search results. diff --git a/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift b/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift index 6c6d1dd8..e5e59d3d 100644 --- a/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift +++ b/TLPhotoPicker/Classes/TLPhotoCollectionViewCell.swift @@ -139,6 +139,7 @@ open class TLPhotoCollectionViewCell: UICollectionViewCell { player.pause() self.player = nil } + self.livePhotoView?.livePhoto = nil self.livePhotoView?.isHidden = true self.livePhotoView?.stopPlayback() self.livePhotoView?.delegate = nil @@ -169,8 +170,6 @@ open class TLPhotoCollectionViewCell: UICollectionViewCell { override open func prepareForReuse() { super.prepareForReuse() stopPlay() - self.livePhotoView?.isHidden = true - self.livePhotoView?.delegate = nil self.durationView?.isHidden = true self.durationView?.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6) self.selectedHeight?.constant = 10