@Override
    public final void cleanup() {
        log.log(Level.FINEST, "cleanup():{0}", this);

        if (isEnabled()) {
            log.log(Level.FINEST, "onDisable():{0}", this);
            onDisable();
        }
        cleanup(app);
        initialized = false;
    }
Do not call directly: Called by the state manager to terminate this
 state post-detachment or during state manager termination.
 This implementation calls onDisable() if the state is enabled and
 then cleanup(app).
jme3-core/src/main/java/com/jme3/app/state/BaseAppState.java