I'm having an issue rendering in OpenGL ES 1.1 for an iPhone game that I'm building.

In short, I am rendering 3 items:

  1. Background (works fine)
  2. A number of spherical objects (works fine)
  3. A simple line circle that changes size (I am getting a problem here).

Basically, I am getting an EXC_BAD_ACCESS error when I call drawArrays on the circle. I have tested the code in the basic iPhone OpenGL template and it works just fine, so I can't really track why it's not working here. Can someone point me in the right way?

Here is the drawCircle code used to render the circle.

- (void) drawCircles
{
if (!m_circleEffects.empty())
{
    int segments = 24;
    for (int i = 0; i < m_circleEffects.size(); i++)
    {
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glTranslatef(m_circleEffects[i].position.x, m_circleEffects[i].position.y, 0);

        float radius;
        if(m_circleEffects[i].isPulseOutward)
            radius = cos(m_circleEffects[i].frameCounter * M_PI / 720);
        else
            radius = sin(m_circleEffects[i].frameCounter * M_PI / 720);

        GLfloat circlePoints[segments * 3];                    
        int count = 0;

        for (GLfloat i = 0; i < 360.0f; i += (360.0f / segments))
        {
            circlePoints[count++] = (cos(i * M_PI / 180) * radius);
            circlePoints[count++] = (sin(i * M_PI / 180) * radius);
            circlePoints[count++] = z + 1;
        }

        glEnableClientState(GL_VERTEX_ARRAY);  
        glVertexPointer(3, GL_FLOAT, 0, circlePoints);                       
        glDrawArrays(GL_LINE_LOOP, 0, segments);   
        glDisableClientState(GL_VERTEX_ARRAY);
    }      
    m_circleEffects.clear();
}
}

And the following is my other rendering code. It is called prior to the above code in the run loop. Everything in the following seems to work OK.

- (void)passInVisualsToU
Edit
Report