changeset 2862:a8bd5f04f4fb

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 335093475c11
children 278bd32a15de
files src/share/classes/java/awt/SplashScreen.java src/share/classes/java/awt/Window.java
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/SplashScreen.java	Tue Oct 12 15:52:58 2010 +0400
+++ b/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/src/share/classes/java/awt/Window.java	Tue Oct 12 15:52:58 2010 +0400
+++ b/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();
         }
     }