6887286: StackOverflowError at sun.awt.image.ImageWatched$WeakLink.isWatcher
authordbuck
Mon, 17 Oct 2011 19:06:24 -0700
changeset 10870 710b7036a3a1
parent 10869 df518de6f6fd
child 10871 c0aeb0b14df1
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
jdk/src/share/classes/sun/awt/image/OffScreenImageSource.java
--- 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);