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?
destroyBody()
with a body count < 1. Are you sure it is being created succesfully? \$\endgroup\$