changeset 6490:73f0beec1171

RT-36232: [Quantum] SecurityException on exit when running any FX program with security manager Reviewed-by: felipe, anthony
author kcr
date Mon, 17 Mar 2014 05:28:19 -0700
parents c0d5845f82d5
children c7f043d40430
files modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java	Mon Mar 17 05:28:19 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java	Mon Mar 17 05:28:19 2014 -0700
@@ -703,7 +703,12 @@
             renderer.stopRenderer();
 
             try {
-                Runtime.getRuntime().removeShutdownHook(shutdownHook);
+                AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                    @Override public Void run() {
+                        Runtime.getRuntime().removeShutdownHook(shutdownHook);
+                        return null;
+                    }
+                });
             } catch (IllegalStateException ignore) {
                 // throw when shutdown hook already removed
             }