> ## 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

立即回收與聊天執行個體相關聯的所有資源。

<a id="syntaxSection" />

## 語法

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

<a id="parametersSection" />

### 參數

無。

<a id="retvalSection" />

### 傳回值

類型：void

無。

<a id="remarksSection" />

## 備註

此方法會立即回收與此聊天執行個體相關聯的所有資源。當應用程式不再需要使用 Game Chat 2 進行通訊，或應用程式暫停時，請呼叫此方法以釋放配置給已初始化聊天執行個體的資源。每次呼叫 [chat\_manager::initialize](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize) 方法，都必須有一個對應的此方法呼叫。如需初始化和清除聊天執行個體的詳細資訊，請參閱[使用 Game Chat 2 C++ API](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2)。

<a id="requirementsSection" />

## 需求

**標頭：** GameChat2.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[Game Chat 2 簡介](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_manager](/zh-TW/reference/chat/gamechat2/classes/chat_manager/chat_manager)


## Related topics

- [chat_manager::initialize](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_initialize.md)
- [chat_manager::get_chat_users](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_chat_users.md)
- [chat_manager::set_memory_callbacks](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md)
- [Game Chat 2 簡介](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro.md)
- [chat_manager::set_thread_processor](/zh-TW/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_processor.md)
