---
title: "VTPixelTransferSessionInvalidate(_:)"
framework: videotoolbox
role: symbol
role_heading: Function
path: "videotoolbox/vtpixeltransfersessioninvalidate(_:)"
---

# VTPixelTransferSessionInvalidate(_:)

Tears down a pixel transfer session.

## Declaration

```swift
func VTPixelTransferSessionInvalidate(_ session: VTPixelTransferSession)
```

## Parameters

- `session`: The pixel transfer session to invalidate.

## Discussion

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