> For the complete documentation index, see [llms.txt](https://sneakyevil.gitbook.io/sleeping-dogs-de-script-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sneakyevil.gitbook.io/sleeping-dogs-de-script-api/callbacks/onunload.md).

# OnUnload

This callback is called when your script is about to get unloaded.

#### Example:

{% hint style="info" %}
Most basic stuff will be cleaned for you like: <mark style="color:red;">Fonts, Images, SimObjects, etc...</mark>
{% endhint %}

```squirrel
function OnUnload()
{
    // Your cleanup code...
}
```
