Error in destroying object in Box2D/LibGDX
Posted
by
Crypted
on Game Development
See other posts from Game Development
or by Crypted
Published on 2012-12-14T13:59:11Z
Indexed on
2012/12/14
17:21 UTC
Read the original article
Hit count: 731
I'm trying to delete an object when a collision happens. I have put the following code in the render method of the object so it would be outside of the physics calculations.
public void render(SpriteBatch spriteBatch) {
// some other code...
body.setActive(false);
body.getWorld().destroyBody(body);
But I'm getting an run-time error which crashes the JVM and shows,
AL lib: alc_cleanup: 1 device not closed
Assertion failed!
Program: C:\Program Files\Java\jre6\bin\javaw.exe File: /var/lib/hudson/jobs/libgdx-git/workspace/gdx/jni/Box2D/Dynamics/b2World.cpp, Line 133
Expression: m_bodyCount > 0
Can anyone help me here?
© Game Development or respective owner