fixed #253 : OpenGL errors when close MacApp window