Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.