Try a release just before - maybe you are using a lineto or some other command that locks the surface.