mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 18:57:43 +00:00
Merge pull request #1297 from McLoo/master
Stop recycled bitmap crashes
This commit is contained in:
commit
4caff2e511
@ -13,7 +13,6 @@ import android.util.Log;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@ -89,7 +88,7 @@ public class BitmapUtil {
|
||||
|
||||
Log.w("BitmapUtil", "Scaling to max width and height: " + aspectWidth + "," + aspectHeight);
|
||||
Bitmap scaledThumbnail = Bitmap.createScaledBitmap(roughThumbnail, (int)aspectWidth, (int)aspectHeight, true);
|
||||
roughThumbnail.recycle();
|
||||
if (roughThumbnail != scaledThumbnail) roughThumbnail.recycle();
|
||||
return scaledThumbnail;
|
||||
} else {
|
||||
return roughThumbnail;
|
||||
|
Loading…
x
Reference in New Issue
Block a user