mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
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…
Add table
Reference in a new issue