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

# CFMessagePortInvalidationCallBack

Callback invoked when a CFMessagePort object is invalidated.

```
typealias CFMessagePortInvalidationCallBack = (CFMessagePort?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`ms`

The message port that has been invalidated.

`info`

The `info` member of the [`CFMessagePortContext`](/documentation/CoreFoundation/CFMessagePortContext) structure that was used when creating `ms`, if `ms` is a local port; `NULL` if `ms` is a remote port.

## Discussion

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

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

---

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)