mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-22 15:31:07 +00:00
* Android: fix Bitmap memory leaks in PhotosHandler Bitmaps created by decodeScaledBitmap and intermediate scaled copies inside encodeJpegUnderBudget were never recycled, leaking native memory on every photos.latest invocation (up to 20 bitmaps per call). - latest(): wrap bitmap usage in try/finally to guarantee recycle - decodeScaledBitmap(): recycle the decoded bitmap after scaling - encodeJpegUnderBudget(): use try/finally to recycle intermediate scaled bitmaps on all exit paths (success, compress failure, and cannot-shrink-further early returns) Made-with: Cursor * Android: guard decodeScaledBitmap against scale() exceptions * fix: note Android photos bitmap cleanup (#41888) (thanks @Kaneki-x) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>