---
title: clearGLContext()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsopenglview/clearglcontext()
---

# clearGLContext()

Releases the NSOpenGLContext object associated with the view.

## Declaration

```swift
func clearGLContext()
```

## Discussion

Discussion If necessary, this method calls the clearDrawable() method of the context object before releasing it.

## See Also

### Managing the NSOpenGLContext

- [prepareOpenGL()](appkit/nsopenglview/prepareopengl().md)
- [openGLContext](appkit/nsopenglview/openglcontext.md)
