---
title: xpc_retain
framework: xpc
role: symbol
role_heading: Function
path: xpc/xpc_retain
---

# xpc_retain

Increments the reference count of an object.

## Declaration

```occ
extern xpc_object_txpc_retain(xpc_object_t object);
```

## Parameters

- `object`: The object which is to be manipulated.

## Return Value

Return Value The object which was given.

## Discussion

Discussion Calls to xpc_retain must be balanced with calls to xpc_release to avoid leaking memory.

## See Also

### Object life cycle

- [xpc_release](xpc/xpc_release.md)
