---
title: invalidate()
framework: extensionfoundation
role: symbol
role_heading: Instance Method
path: extensionfoundation/appextensionprocess/invalidate()
---

# invalidate()

Invalidates the host app’s connection to the app extension process.

## Declaration

```swift
func invalidate()
```

## Mentioned in

Adding support for app extensions to your app

## Discussion

Discussion Call this method when you finish communicating with an app extension and no longer need it. If the current object represents the last connection to the app extension, the system terminates the app extension’s process. After calling this method, don’t try to communicate with the app extension using XPC. Instead, remove any references to the app extension and release this AppExtensionProcess type.
