Last Updated: February 25, 2016
·
1.451K
· drabiter

[LibGDX] Problematic frames

It happens because you try to dispose resources that had been disposed.

batch.dispose();
stage.dispose();

From source code of Stage class

public void dispose () {
    if (ownsBatch) batch.dispose();
}

Exception from JVM will be given if your batch is reference of Stage's SpriteBatch. (The odd is high, we rarely create new SpriteBatch if we use Stage)

The solution? Call dispose() once on either the stage or spritebatch reference.