bevy / photo-editor

Photo editor with a lot of cool features
MIT License
882 stars 336 forks source link

PhotoEditorViewController leaking memory via retain cycle #41

Open jonchui opened 6 years ago

jonchui commented 6 years ago

When you push the PhotoEditorViewController and finish, you can see in the Xcode memory guage that a huge amount of heap memory isn't getting released. Most likely due to the image.

Here i've edited 5 different photos, going back to the main screen each time (which should reset the heap) . You can see every time the heap increases but does not go down after popping:

image

jonchui commented 6 years ago

After fixing those initial leaks (cause by retain cycles w/ non-weak delegates), i found some more:

image

Here's a gif of my run: http://recordit.co/UISvPsprVd.gif

jonchui commented 6 years ago

FYI: i opened PR https://github.com/eventtus/photo-editor/pull/42 that fixes it ;)