> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblCleanupAsync

> XblCleanupAsync

Asynchronously releases all resources associated with the library.

## Syntax

```cpp theme={null}
HRESULT XblCleanupAsync(  
         XAsyncBlock* async  
)  
```

### Parameters

*async*   \
Type: XAsyncBlock\*

The AsyncBlock for this operation. Keep the `XAsyncBlock` valid until the operation completes.

### Return value

Type: HRESULT

HRESULT return code for this API operation. Returns `E_XBL_NOT_INITIALIZED` if the library isn't initialized. To get the final result of the cleanup operation, call `XAsyncGetStatus(async, false)` after the operation completes.

## Remarks

Wait for any outstanding asynchronous calls that your game started to complete before you call this function. If there are pending background asynchronous tasks that XSAPI started, this function waits for them to complete.

If you called [XblMemSetFunctions](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblmemsetfunctions.md), wait for this operation to complete before you shut down your app's memory manager.

## Requirements

**Header:** xbox\_live\_global\_c.h

**Library:** Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[xbox\_live\_global\_c](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/xbox_live_global_c_members.md)


## Related topics

- [How to use XBOX services APIs](https://docs.xbox.com/services/xbox-services/fundamentals/xbox-services-api/live-gs-xbl-apis.md)
- [XblGetScid](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblgetscid.md)
- [XblInitialize](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_global_c/functions/xblinitialize.md)
- [HCInitialize](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hcinitialize.md)
- [XblSocialManagerDoWork](https://docs.xbox.com/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerdowork.md)
