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

# chat_manager::cleanup

> chat_manager::cleanup

# chat\_manager::cleanup

Immediately reclaims all resources associated with the chat instance.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
void cleanup(  
)  
```

<a id="parametersSection" />

### Parameters

None.

<a id="retvalSection" />

### Return value

Type: void

None.

<a id="remarksSection" />

## Remarks

This method immediately reclaims all resources associated with this chat instance. Call this method when the app no longer requires communications using Game Chat 2, or when the app is suspended, to release resources allocated to the initialized chat instance. Every call to the [chat\_manager::initialize](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize) method must have a corresponding call to this method. For more information about initializing and cleaning up a chat instance, see [Using the Game Chat 2 C++ API](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2).

<a id="requirementsSection" />

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[Intro to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_manager](/reference/chat/gamechat2/classes/chat_manager/chat_manager)


## Related topics

- [chat_manager::initialize](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize.md)
- [chat_manager::get_chat_users](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_chat_users.md)
- [chat_manager::set_memory_callbacks](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md)
- [chat_manager::set_thread_processor](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_processor.md)
- [chat_manager::set_thread_affinity_mask](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_affinity_mask.md)
