Getting the dangerous exception "Iterator cannot be used nested"

Accidentally getting this exception in my 3D game (using libgdx nightly build from 2014-01-03). Sometimes not for several days, sometimes 5 times in 10 minutes. On the emulator almost never happens. Could not find any reproducible scenario for several weeks, it can happen even if I don’t touch the tablet at all. (I had a feeling that moving the camera or touching the screen is more likely to do this, but cannot prove it). Usually occurs when a long workflow (computer thinking, continuous rendering is turned off during this) is completed and some models move to show results.

It always happens on one instance of the model, consisting of 100 nodes (each node is a textured block created by six calls rect()). Some nodes may be in short animation. I do not request an iterator anywhere in my own code, I go through nodes with a normal loop for()because their number is fixed.

Any suggestions on how to initiate an investigation into this are appreciated. The only clue I could have when I had the above fields as 100 different instances of the model, the exception occurred a little less often. Today I combined them into one large model and already got an exception 10 times.

E/AndroidRuntime(30999): com.badlogic.gdx.utils.GdxRuntimeException: #iterator() cannot be used nested.
E/AndroidRuntime(30999):    at com.badlogic.gdx.utils.Array$ArrayIterator.hasNext(Array.java:487)
E/AndroidRuntime(30999):    at com.badlogic.gdx.graphics.g3d.ModelInstance.getRenderables(ModelInstance.java:356)
E/AndroidRuntime(30999):    at com.badlogic.gdx.graphics.g3d.ModelInstance.getRenderables(ModelInstance.java:328)
E/AndroidRuntime(30999):    at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:281)
E/AndroidRuntime(30999):    at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:296)
+3
source share
1 answer

, . AnimationController, , :

modelInstanceTiles.nodes.get(nodeIndex).translation.set(pos);
modelInstanceTiles.nodes.get(nodeIndex).rotation.set(rot);
modelInstanceTiles.calculateTransforms();

3 .

+1

All Articles