branch in render()

I have a render method like this:

(cnt is a global variable)
render(){

cnt++;
glutWireCube(1.0);
if(cnt > 1000)
glutSolidCube(1.0);
glutSwapBuffers();
}

When cnt>1000, the wire cube disapeared, and the solid cube isn’t drawn.

Is it not allowed to have brance statement in the callback function for glutDisplayFunc()?

never mind.
I find the problem.

I have to resize the window to re-compute the matrix.