changeset 6823:cff6c85026c4

6990352: SplashScreen.getSplashScreen() does not return null for implicitly closed splash screen Summary: Mark the splash screen closed when it happens implicitly Reviewed-by: art, dcherepanov
author anthony
date Tue, 12 Oct 2010 18:20:07 +0400
parents 0a6eba317c96
children 053f05edc068
files jdk/src/share/classes/java/awt/SplashScreen.java jdk/src/share/classes/java/awt/Window.java
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/java/awt/SplashScreen.java	Tue Oct 12 15:52:58 2010 +0400
+++ b/jdk/src/share/classes/java/awt/SplashScreen.java	Tue Oct 12 18:20:07 2010 +0400
@@ -318,6 +318,12 @@
             checkVisible();
             _close(splashPtr);
             image = null;
+            SplashScreen.markClosed();
+        }
+    }
+
+    static void markClosed() {
+        synchronized (SplashScreen.class) {
             wasClosed = true;
             theInstance = null;
         }
--- a/jdk/src/share/classes/java/awt/Window.java	Tue Oct 12 15:52:58 2010 +0400
+++ b/jdk/src/share/classes/java/awt/Window.java	Tue Oct 12 18:20:07 2010 +0400
@@ -928,7 +928,10 @@
             return;
         }
         if (beforeFirstWindowShown.getAndSet(false)) {
+            // We don't use SplashScreen.getSplashScreen() to avoid instantiating
+            // the object if it hasn't been requested by user code explicitly
             SunToolkit.closeSplashScreen();
+            SplashScreen.markClosed();
         }
     }