crash in void CCTextureAtlas::drawNumberOfQuads's glDrawElements with CC_ENABLE_GL_STATE_CACHE 1

The code crash in glDrawElements. After checking, it will be fine if CC_ENABLE_GL_STATE_CACHE is 0.
I think there is a problem in ccGLBindVAO(m_uVAOname); It seems it doesn’t actually bind due to state unchanged (but actually changed.), with the modification below, it works even with CC_ENABLE_GL_STATE_CACHE = 1

void ccGLBindVAO(GLuint vaoId)
{
#if CC_TEXTURE_ATLAS_USE_VAO

#if CC_ENABLE_GL_STATE_CACHE__
if (s_uVAO != vaoId)
{
s_uVAO = vaoId;
glBindVertexArray(vaoId);
}
#else
glBindVertexArray(vaoId);
#endif // CC_ENABLE_GL_STATE_CACHE

#endif
}

It seems it is better than disable the state cache function, but still don’t know why.

Have you solved this issue, please?