StrongJoshua / libgdx-inGameConsole

A LibGdx library that allows a developer to add a console (similar to how it is featured in Source games) to their game.
https://www.strongjoshua.net/projects/games/libgdx-ingame-console
Apache License 2.0
132 stars 34 forks source link

Crashes when log method is called. #38

Closed Blunderchips closed 5 years ago

Blunderchips commented 6 years ago

Crashing with the following exception.

Exception in thread "LWJGL Application" java.lang.IndexOutOfBoundsException: index can't be >= size: 26 >= 0 at com.badlogic.gdx.utils.Array.removeIndex(Array.java:260) at com.badlogic.gdx.utils.SnapshotArray.removeIndex(SnapshotArray.java:130) at com.badlogic.gdx.utils.Array.removeValue(Array.java:243) at com.badlogic.gdx.utils.SnapshotArray.removeValue(SnapshotArray.java:125) at com.badlogic.gdx.scenes.scene2d.Group.removeActor(Group.java:330) at com.badlogic.gdx.scenes.scene2d.ui.Table.removeActor(Table.java:298) at com.badlogic.gdx.scenes.scene2d.Actor.remove(Actor.java:216) at com.badlogic.gdx.scenes.scene2d.ui.Table.clearChildren(Table.java:310) at com.badlogic.gdx.scenes.scene2d.Group.clear(Group.java:357) at com.strongjoshua.console.GUIConsole$ConsoleDisplay.refresh(GUIConsole.java:420) at com.strongjoshua.console.GUIConsole.log(GUIConsole.java:275)

This issue can be replicated by logging a lot of messages to the console. I suspect the console is trying to remove a log that has already been removed.

StrongJoshua commented 6 years ago

I'll look into this tomorrow. A strange issue.

StrongJoshua commented 6 years ago

I can't replicate it. Try out the Box2DTest and just hold the mouse button down to create 'explosions'. Even when setting the max entries to Console.UNLIMITED_ENTRIES it still works fine.

Can you post a minimal example?

StrongJoshua commented 5 years ago

No follow-up. Closing this issue.