---
title: onExit
framework: tvmljs
role: symbol
role_heading: Instance Property
path: tvmljs/app/1627419-onexit
---

# onExit

A callback function that is automatically called when the app has been exited.

## Declaration

```data
attribute function onExit;
```

## Discussion

Discussion Use the onExit attribute to complete any actions that need to be cleaned up (for example, releasing any system resources) when the app has been exited. This attribute must be set to a function that accepts an options argument; for example App.onExit = function (options) {}. The options argument can contain the following keys: reloading—Set to true if the app is exiting as a result of App.reload() and is to be relaunched later.

## See Also

### Responding to App Life Cycle Events

- [onError](tvmljs/app/1627353-onerror.md)
- [onLaunch](tvmljs/app/1627407-onlaunch.md)
- [onResume](tvmljs/app/1627415-onresume.md)
- [onSuspend](tvmljs/app/1627431-onsuspend.md)
