Fix crash due to recycled bitmap when edited bitmap returned is the same as source...
This commit is contained in:
parent
7832bc03d9
commit
459482b52b
1 changed files with 12 additions and 4 deletions
|
@ -913,8 +913,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
if (bm_tmp != null) {
|
||||
bm.recycle();
|
||||
bm = bm_tmp;
|
||||
if (bm_tmp != bm) {
|
||||
bm.recycle();
|
||||
bm = bm_tmp;
|
||||
} else {
|
||||
bm_tmp = null;
|
||||
}
|
||||
}
|
||||
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
|
@ -1545,8 +1549,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
matrix.postRotate(270);
|
||||
}
|
||||
bm_tmp = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
|
||||
bm.recycle();
|
||||
bm = bm_tmp;
|
||||
if (bm_tmp != bm) {
|
||||
bm.recycle();
|
||||
bm = bm_tmp;
|
||||
} else {
|
||||
bm_tmp = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue