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) {
|
if (bm_tmp != null) {
|
||||||
bm.recycle();
|
if (bm_tmp != bm) {
|
||||||
bm = bm_tmp;
|
bm.recycle();
|
||||||
|
bm = bm_tmp;
|
||||||
|
} else {
|
||||||
|
bm_tmp = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
@ -1545,8 +1549,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
matrix.postRotate(270);
|
matrix.postRotate(270);
|
||||||
}
|
}
|
||||||
bm_tmp = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
|
bm_tmp = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
|
||||||
bm.recycle();
|
if (bm_tmp != bm) {
|
||||||
bm = bm_tmp;
|
bm.recycle();
|
||||||
|
bm = bm_tmp;
|
||||||
|
} else {
|
||||||
|
bm_tmp = null;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(e);
|
Log.e(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue