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

# cleanup

> chat_manager::cleanup

# chat\_manager::cleanup

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

## 語法

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

### 參數

無。

### 傳回值

類型：void

無。

## 備註

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

## 需求

**標頭：** GameChat2.h

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

## 另請參閱

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


## Related topics

- [HCCleanup](https://docs.xbox.com/zh-TW/reference/live/httpclient/httpclient/functions/hccleanup.md)
- [HCTraceCleanup](https://docs.xbox.com/zh-TW/reference/live/httpclient/trace/functions/hctracecleanup.md)
- [HCCleanupAsync](https://docs.xbox.com/zh-TW/reference/live/httpclient/httpclient/functions/hccleanupasync.md)
- [XblCleanupAsync](https://docs.xbox.com/zh-TW/reference/live/xsapi-c/xbox_live_global_c/functions/xblcleanupasync.md)
- [PartyManager::Cleanup](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_cleanup.md)
