burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.07k stars 981 forks source link

Leak Graphics memory when changing filter. #522

Closed longdt57 closed 1 year ago

longdt57 commented 1 year ago

Describe the bug Leak Graphics memory when changing filter.

To Reproduce Steps to reproduce the behavior:

  1. Go to Filter tab
  2. Change Filter multiple times
  3. See Profile memory

Expected behavior No Leak memory

Screenshots/Video/GIFs image

Smartphone Info:

Additional context Those line of code is the root cause. setFilterEffect-setSourceBitmap-1

[setFilterEffect-setSourceBitmap-2] https://github.com/burhanrashid52/PhotoEditor/blob/master/photoeditor/src/main/java/ja/burhanrashid52/photoeditor/PhotoEditorView.kt#L154

burhanrashid52 commented 1 year ago

Thank you for reporting this. Do you have a fix or any suggestion fro this?

longdt57 commented 1 year ago

Yes, I do Please remove lines 148 and 154 at class: PhotoEditorView. Line 48 already called the setSourceBitmap.

burhanrashid52 commented 1 year ago

Yes, I do Please remove lines 148 and 154 at class: PhotoEditorView. Line 48 already called the setSourceBitmap.

Thanks for the PR. Have you tested it with these PR changes? Also, some unit tests are failing.

longdt57 commented 1 year ago

I run test on my laptop and it passes all unit/ui test. Humm