Geometry's setModelBound causes "TempVars was already released" ISE

As the title says, using .setModelBound(…) on a geometry causes the following:



[java]

Jun 28, 2011 9:45:10 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalStateException: This instance of TempVars was already released!

at com.jme3.util.TempVars.release(TempVars.java:132)

at com.jme3.bounding.BoundingSphere.recurseMini(BoundingSphere.java:266)

at com.jme3.bounding.BoundingSphere.calcWelzl(BoundingSphere.java:197)

at com.jme3.bounding.BoundingSphere.computeFromPoints(BoundingSphere.java:126)

at com.jme3.scene.Mesh.updateBound(Mesh.java:1095)

at com.jme3.scene.Geometry.updateModelBound(Geometry.java:233)

at com.jme3.scene.Geometry.setModelBound(Geometry.java:318)

at com.madjack.games.sc.scenes.GalaxyScene.pinStarsInternal(GalaxyScene.java:182)

at com.madjack.games.sc.scenes.GalaxyScene.pinStars(GalaxyScene.java:146)

at com.madjack.games.sc.scenes.GalaxyScene.createSceneView(GalaxyScene.java:341)

at com.madjack.games.sc.scenes.GalaxyScene.setEnabled(GalaxyScene.java:321)

at com.madjack.games.sc.GameState.switchScenes(GameState.java:382)

at com.madjack.games.sc.Base.simpleUpdate(Base.java:182)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:248)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:179)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)

at java.lang.Thread.run(Thread.java:662)

[/java]

Are you by any chance modifieng the Scenegraph outside of the update/opengl thread?

Nope. It’s all done inside the LWJGL Renderer Thread as the above pasted error message says. It’s not a Future either.



From my understanding, the following call should have either one of those release() removed. I’d go with the inside the IF one.



BoundingSphere.java

[java]



for (int i = 0; i < p; i++) {

BufferUtils.populateFromBuffer(tempA, points, i + ap);

if (tempA.distanceSquared(center) - (radius * radius) > RADIUS_EPSILON - 1f) {

for (int j = i; j > 0; j–) {

BufferUtils.populateFromBuffer(tempB, points, j + ap);

BufferUtils.populateFromBuffer(tempC, points, j - 1 + ap);

BufferUtils.setInBuffer(tempC, points, j + ap);

BufferUtils.setInBuffer(tempB, points, j - 1 + ap);

}

// vars.release();

recurseMini(points, i, b + 1, ap + 1);

}

}

vars.release();

}

[/java]



For now that’s what I have done so I can run the game. No problems up until now.

Well, that was easy