From a74c41bb00bb2fd0a6d2a5470332dbaa1e53958c Mon Sep 17 00:00:00 2001 From: gkw Date: Tue, 17 Aug 2004 05:56:47 +0000 Subject: addShutdownHook needed to be wrapped in a call to AccessController.doPrivileged in order to work with applets and Web Start. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@153 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../java/games/jogl/impl/windows/WindowsGLContextFactory.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/net/java/games/jogl') diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContextFactory.java b/src/net/java/games/jogl/impl/windows/WindowsGLContextFactory.java index 6603dc2eb..0f4b1d03c 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsGLContextFactory.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLContextFactory.java @@ -40,10 +40,11 @@ package net.java.games.jogl.impl.windows; import java.awt.Component; -import java.awt.Frame; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.Rectangle; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -70,7 +71,12 @@ public class WindowsGLContextFactory extends GLContextFactory { private static Set/**/ pendingContextSet = new HashSet(); public WindowsGLContextFactory() { - Runtime.getRuntime().addShutdownHook( new ShutdownHook() ); + AccessController.doPrivileged( new PrivilegedAction() { + public Object run() { + Runtime.getRuntime().addShutdownHook( new ShutdownHook() ); + return( null ); + } + }); } public GraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities, -- cgit v1.2.3