iOS 17 UIImageReader has memory leaks

In my SwiftUI view, I try to load the image from data.

var body: some View {
        Group{
            if let data = model.detailImageData, let uiimage = UIImage(data: data) {// no memory issue
                Image(uiImage: uiimage)
                    .resizable()
                    .scaledToFit()
            }
        }
   }

But I want to get the HDR style of my image, so I use

if let data = model.detailImageData, let uiimage = UIImageReader.default.image(data:data){ //memory leaks!!!

When I change the data, the memory of the previous image is never freeed. finally caused my app to crash. You can see it from the Instrument screenshot.

Having the same issue. Here is the demo to reproduce this issue:

https://github.com/JuniperPhoton/HDRMemoryIssueDemo

This issue still exists on iOS 18 Developer Beta.

iOS 17 UIImageReader has memory leaks
 
 
Q