Windows: replace loadLibrary("jawt") with Toolkit.getDefaultToolkit() which is better and avoids classloader issues with multiple loaded natives. Additionally, getDefaultToolkit is not a privileged action, while loadLibrary is.

This commit is contained in:
Elias Naur 2006-06-28 21:16:14 +00:00
parent 1a0dde001c
commit 8ee5b8d931
1 changed files with 3 additions and 6 deletions

View File

@ -33,6 +33,7 @@ package org.lwjgl.opengl;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.Toolkit;
import java.security.PrivilegedAction;
import java.security.AccessController;
@ -46,12 +47,8 @@ import org.lwjgl.LWJGLException;
*/
final class Win32CanvasImplementation implements AWTCanvasImplementation {
static {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
System.loadLibrary("jawt");
return null;
}
});
// Make sure the awt stuff is properly initialised (the jawt library in particular)
Toolkit.getDefaultToolkit();
}
public PeerInfo createPeerInfo(AWTGLCanvas canvas, PixelFormat pixel_format) throws LWJGLException {