---
title: "releaseCGLContext(_:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/caopengllayer/releasecglcontext(_:)"
---

# releaseCGLContext(_:)

Releases the specified rendering context.

## Declaration

```swift
func releaseCGLContext(_ ctx: CGLContextObj)
```

## Parameters

- `ctx`: The rendering context to release.

## Discussion

Discussion This method is called when the OpenGL context that was previously returned by copyCGLContext(forPixelFormat:) is no longer needed. You should not call this method directly, it is intended to be overridden by subclasses.

## See Also

### Managing the Rendering Context

- [copyCGLContext(forPixelFormat:)](quartzcore/caopengllayer/copycglcontext(forpixelformat:).md)
