<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFMachPortInvalidationCallBack",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFMachPortInvalidationCallBack"
  },
  "title" : "CFMachPortInvalidationCallBack"
}
-->

# CFMachPortInvalidationCallBack

Callback invoked when a CFMachPort object is invalidated.

```
typealias CFMachPortInvalidationCallBack = (CFMachPort?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`port`

The CFMachPort object that has been invalidated.

`info`

The `info` member of the [`CFMachPortContext`](/documentation/CoreFoundation/CFMachPortContext) structure used when creating `port`.

## Discussion

Your callback should free any resources allocated for `port`.

You specify this callback with [`CFMachPortSetInvalidationCallBack(_:_:)`](/documentation/CoreFoundation/CFMachPortSetInvalidationCallBack(_:_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)