|
From: <ka...@us...> - 2011-01-12 20:01:19
|
Revision: 3466
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3466&view=rev
Author: kappa1
Date: 2011-01-12 20:01:12 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
Fixed null pointer exception in AppletLoader caused by cleaning up resources in the middle of a paint call. Thx to NateS for point this out and suggesting the fix.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-11 20:54:26 UTC (rev 3465)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-01-12 20:01:12 UTC (rev 3466)
@@ -230,7 +230,7 @@
protected String subtaskMessage = "";
/** state of applet loader */
- protected int state = STATE_INIT;
+ protected volatile int state = STATE_INIT;
/** whether lzma is supported */
protected boolean lzmaSupported;
@@ -406,6 +406,7 @@
public void paint(Graphics g) {
// don't paint loader if applet loaded
if(state == STATE_DONE) {
+ cleanUp(); // clean up resources
return;
}
@@ -767,8 +768,6 @@
switchApplet();
state = STATE_DONE;
- // clean up resources
- cleanUp();
} catch (AccessControlException ace) {
fatalErrorOccured(ace.getMessage(), ace);
certificateRefused = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|