---
title: "gss_delete_sec_context(_:_:_:)"
framework: GSS
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, Mac Catalyst 13.1+, macOS 10.7+, visionOS 1.0+]
path: "gss/gss_delete_sec_context(_:_:_:)"
---

# gss_delete_sec_context(_:_:_:)

Deletes a security context.

## Declaration

```swift
func gss_delete_sec_context(_ minor_status: UnsafeMutablePointer<OM_uint32>, _ context_handle: UnsafeMutablePointer<gss_ctx_id_t?>, _ output_token: gss_buffer_t?) -> OM_uint32
```

## Parameters

- `minor_status`: A pointer to the secondary status result that provides additional information in case of failure.
- `context_handle`: The context to be deleted.
- `output_token`: A buffer that the function may fill with a token to send to the peer application. Typically, you pass doc://com.apple.gss/documentation/GSS/GSS_C_NO_BUFFER, indicating that no token is desired, and simply call upon the deletion function to operate locally on both sides of the connection. If a token is created, pass it to the remote peer, and free its memory with a call to doc://com.apple.gss/documentation/GSS/gss_release_buffer(_:_:).

## Return Value

Return Value A status code set to GSS_S_COMPLETE on completion, or GSS_S_NO_CONTEXT if no context was supplied.

## Discussion

Discussion This function purges the context and all of its resources from memory, and frees all of its memory.

## See Also

### Creation and Deletion

- [gss_init_sec_context(_:_:_:_:_:_:_:_:_:_:_:_:_:)](gss/gss_init_sec_context(_:_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [gss_accept_sec_context(_:_:_:_:_:_:_:_:_:_:_:)](gss/gss_accept_sec_context(_:_:_:_:_:_:_:_:_:_:_:).md)
- [gss_release_cred(_:_:)](gss/gss_release_cred(_:_:).md)
- [gss_process_context_token(_:_:_:)](gss/gss_process_context_token(_:_:_:).md)
- [gss_set_sec_context_option(_:_:_:_:)](gss/gss_set_sec_context_option(_:_:_:_:).md)
