mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539356 - Part 29 - Handle OOM exception gracefully during java snapshots. r=jrmuizel
This commit is contained in:
parent
79eed389a6
commit
62f7b73450
@ -123,7 +123,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user