protected void releaseImpl() throws GLException { if (isNSContext) { if (!CGL.clearCurrentContext(contextHandle)) { throw new GLException("Error freeing OpenGL Context (NS)"); } } else { CGL.CGLReleaseContext(contextHandle); } }