---
title: SetAbortedHandler
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osaction/setabortedhandler
---

# SetAbortedHandler

Install a handler for the system to call when no other processes reference the action object.

## Declaration

```occ
kern_return_t SetAbortedHandler(OSActionAbortedHandler handler);
```

## Parameters

- `handler`: A handler block for the system to call. Specify NULL to remove the handler block from your action object.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion The system calls your handler when no other objects reference the action object. If you want to keep the action object, use your handler to retain it. If you don’t retain the object, the system releases it shortly after your handler returns.

## See Also

### Configuring the Action

- [free](driverkit/osaction/free.md)
