---
title: "VTDecompressionSessionInvalidate(_:)"
framework: videotoolbox
role: symbol
role_heading: Function
path: "videotoolbox/vtdecompressionsessioninvalidate(_:)"
---

# VTDecompressionSessionInvalidate(_:)

Tears down a decompression session.

## Declaration

```swift
func VTDecompressionSessionInvalidate(_ session: VTDecompressionSession)
```

## Parameters

- `session`: The decompression session to invalidate.

## Discussion

Discussion When you finish with a decompression session you created, call this function to tear it down, and then CFRelease to release your object reference. note: A decompression session is automatically invalidated when its retain count reaches zero, but because sessions may be retained by multiple parties, it can be hard to predict when this will happen. Calling VTDecompressionSessionInvalidate ensures a deterministic, orderly teardown.
