Fixed the 'glutSwapBuffers' error when program closes