Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aef7541

Browse files
committed
fix leak code and constractor
1 parent 71255ed commit aef7541

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

transformations/src/main/java/jp/wasabeef/glide/transformations/MaskTransformation.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public class MaskTransformation implements Transformation<Bitmap> {
4747
* same make file name. If you have a good idea please tell us, thanks.
4848
*/
4949
public MaskTransformation(Context context, int maskId) {
50-
mBitmapPool = Glide.get(context).getBitmapPool();
51-
mContext = context;
50+
this(context, Glide.get(context).getBitmapPool(), maskId);
51+
}
52+
53+
public MaskTransformation(Context context, BitmapPool pool, int maskId) {
54+
mBitmapPool = pool;
55+
mContext = context.getApplicationContext();
5256
mMaskId = maskId;
5357
}
5458

transformations/src/main/java/jp/wasabeef/glide/transformations/RoundedCornersTransformation.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,18 @@ public RoundedCornersTransformation(Context context, int radius, int margin) {
4949
this(context, radius, margin, CornerType.ALL);
5050
}
5151

52+
public RoundedCornersTransformation(BitmapPool pool, int radius, int margin) {
53+
this(pool, radius, margin, CornerType.ALL);
54+
}
55+
5256
public RoundedCornersTransformation(Context context, int radius, int margin,
5357
CornerType cornerType) {
54-
mBitmapPool = Glide.get(context).getBitmapPool();
58+
this(Glide.get(context).getBitmapPool(), radius, margin, cornerType);
59+
}
60+
61+
public RoundedCornersTransformation(BitmapPool pool, int radius, int margin,
62+
CornerType cornerType) {
63+
mBitmapPool = pool;
5564
mRadius = radius;
5665
mDiameter = mRadius * 2;
5766
mMargin = margin;

0 commit comments

Comments
 (0)