PHLivePhoto.request using custom targetSize parameter cause memory leaks

My app uses PHLivePhoto.request to generate live photos, but memory leaks if I use a custom targetSize.

PHLivePhoto.request(withResourceFileURLs: [imageUrl, videoUrl], placeholderImage: nil, targetSize: targetSize, contentMode: .aspectFit) {[weak self] (livePhoto, info) in

Change targetSize to CGSizeZero, problem resolved.

PHLivePhoto.request(withResourceFileURLs: [imageUrl, videoUrl], placeholderImage: nil, targetSize: CGSizeZero, contentMode: .aspectFit) {[weak self] (livePhoto, info) in

Replies

Thanks for highlighting this issue! I can confirm that I'm able to reproduce a leak when calling the api as you've detailed. If you'd like to receive updates on the issue when it's fixed please file a feedback and reply with the number so I may route it correctly.

  • FB13325139 (PHLivePhoto.request using custom targetSize parameter cause memory leaks)

Add a Comment

Same problem here.

  • What OS are you hitting this on? Have you tried with the latest developer beta?

  • iOS 15.8.1. I haven't tried with any developer beta in the past few years. I'm going to try it with the latest public version.

Add a Comment