---
title: MechanismDestroy
framework: security
role: symbol
role_heading: Instance Property
path: security/authorizationplugininterface/mechanismdestroy
---

# MechanismDestroy

Destroys an authorization mechanism.

## Declaration

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

## Parameters

- `inMechanism`: An authorization mechanism reference that you returned when your doc://com.apple.security/documentation/Security/AuthorizationPluginInterface/MechanismCreate function was called to create the mechanism.

## 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 the authorization engine calls your MechanismDestroy function, you must release all resources owned by your mechanism and do any other cleanup necessary (such as deleting temporary files).
