---
title: PluginDestroy
framework: security
role: symbol
role_heading: Instance Property
path: security/authorizationplugininterface/plugindestroy
---

# PluginDestroy

Notifies the plug-in that it is about to be unloaded.

## Declaration

```occ
int (*)(void *) PluginDestroy;
```

## Parameters

- `inPlugin`: The authorization plug-in reference you assigned to the plug-in in the doc://com.apple.security/documentation/Security/AuthorizationPluginCreate function.

## Return Value

Return Value A result code. Return errAuthorizationSuccess (no error) if the function completes successfully and errAuthorizationInternal (Security Server internal error) if any error occurs.

## Discussion

Discussion When this function is called, your plug-in should release any resources it is holding and do any other cleanup necessary (such as deleting temporary files) before it is unloaded.
