0

I have a little problem with memory usage. When I load images from drive, I use:

func queryFinished(_ notification: Notification) { 
[...]
document?.open(completionHandler: { (success) -> Void in
            if (success == true){
                self.imageArray.insert(compress(document.image), at: index)
                self.collectionView.reloadData()
            }
        }) }
}

Everything fine, after that I compress the images. The problem is memory keeps the big images data. Even if I move back to the root viewcontroller, the memory still keeps the large files.

Is there any way to clear that? Thank you very much!

Selonath
  • 23
  • 3
  • You have a memory leak. Did you unregister the observer of the notification ? – CZ54 May 03 '17 at 12:48
  • Yes, I did, I use that: `NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIContentSizeCategoryDidChange, object: nil)` – Selonath May 03 '17 at 19:18

0 Answers0