libgdx / box2dlights

Fork of box2dlights by Kalle Hamalainen
Apache License 2.0
256 stars 81 forks source link

Error on remove light #29

Closed brnostone closed 9 years ago

brnostone commented 9 years ago

In version 1.2, when I call the method remove of the light, the app crash by this error:

java.lang.IllegalArgumentException: buffer not allocated with newUnsafeByteBuffer or already disposed at com.badlogic.gdx.utils.BufferUtils.disposeUnsafeByteBuffer(BufferUtils.java:507) at com.badlogic.gdx.graphics.glutils.VertexArray.dispose(VertexArray.java:67) at com.badlogic.gdx.graphics.Mesh.dispose(Mesh.java:551) at box2dLight.Light.remove(Light.java:115)

What is the solution? Thanks

rinold commented 9 years ago

Hi there, I tried a simple example and wasn't able to reproduce it. Are you sure dispose is not called twice for the one light? If no, please provide more details about actually what Light are you trying to dispose and when, some minimal code snippet will be good.

brnostone commented 9 years ago

The problem really was that I was calling twice remove. Thank you for your attention.