clean out the last used bitmap

Reviewed By: achen1

Differential Revision: D4828134

fbshipit-source-id: bf54f7c9f61016cc0735338f99de7b0378c1234b
This commit is contained in:
Aaron Chiu
2017-04-04 12:44:04 -07:00
committed by Facebook Github Bot
parent 40eb353487
commit f8e583b2d0
2 changed files with 11 additions and 0 deletions
@@ -47,6 +47,14 @@ public class ScreenshotingFrameLayout extends FrameLayout {
canvas.drawBitmap(mBitmap, 0, 0, null);
}
public void clean() {
if (mBitmap != null) {
mBitmap.recycle();
mBitmap = null;
}
mCanvas.setBitmap(null);
}
private static Bitmap createNewBitmap(Canvas canvas) {
return Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
}