зеркало из https://github.com/mozilla/gecko-dev.git
Bug 539356 - Part 29 - Handle OOM exception gracefully during java snapshots. r=jrmuizel
This commit is contained in:
Родитель
847a97d95f
Коммит
11927c4b90
|
@ -139,7 +139,11 @@ public class ScreenshotLayer extends SingleTileLayer {
|
|||
end = Math.max(start, Math.min(dst.limit(), Math.min(src.capacity(), end)));
|
||||
dst.position(start);
|
||||
src.position(start).limit(end);
|
||||
dst.put(src);
|
||||
// This allocates a lot of memory and can fail sometimes. Handling the
|
||||
// exception is better than crashing.
|
||||
try {
|
||||
dst.put(src);
|
||||
} catch (java.lang.OutOfMemoryError e) {}
|
||||
}
|
||||
|
||||
synchronized void setBitmap(ByteBuffer data, int width, int height, int format, Rect rect) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче