Skip to content

Commit

Permalink
Merge pull request #447 from getbouncer/awush-fix-image-memory-leak
Browse files Browse the repository at this point in the history
Destory created renderscript types
  • Loading branch information
awush-stripe authored Sep 8, 2021
2 parents 8e286a9 + a9ad4a9 commit f00ca0a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ class NV21Image(val width: Int, val height: Int, val nv21Data: ByteArray) {
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
rgbAllocation.copyTo(bitmap)

// remove allocated objects
yuvType.destroy()
yuvAllocation.destroy()
rgbAllocation.destroy()
yuvToRgbScript.destroy()

return bitmap
}
}
Expand Down

0 comments on commit f00ca0a

Please sign in to comment.