6887286: StackOverflowError at sun.awt.image.ImageWatched$WeakLink.isWatcher
Summary: Fixed OffScreenImageSource to call imageComplete() with SINGLEFAMEDONE, not STATICIMAGEDONE. This fixed memory leak (that caused SOFE when we use recursion to iterate over linked list).
Reviewed-by: bae
--- a/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java Mon Oct 17 17:19:43 2011 +0400
+++ b/jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java Mon Oct 17 19:06:24 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -185,7 +185,7 @@
theConsumer.setDimensions(image.getWidth(), image.getHeight());
theConsumer.setProperties(properties);
sendPixels();
- theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
+ theConsumer.imageComplete(ImageConsumer.STATICIMAGEDONE);
} catch (NullPointerException e) {
if (theConsumer != null) {
theConsumer.imageComplete(ImageConsumer.IMAGEERROR);