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

# game_chat_free_memory_callback

> game_chat_free_memory_callback

# game\_chat\_free\_memory\_callback

Representa um retorno de chamada invocado sempre que um buffer de memória alocado anteriormente não é mais necessário para a biblioteca do Game Chat 2 e pode ser liberado.

<a id="syntaxSection" />

## Sintaxe

```cpp theme={null}
typedef  
void  
(game_chat_callback * game_chat_free_memory_callback)(  
    _In_ _Post_invalid_ void * pointer,  
    _In_ uint32_t memoryTypeId  
    );  
```

<a id="parametersSection" />

### Parâmetros

*pointer*   \_In\_ \_Post\_invalid\_\
Tipo: void\*

O ponteiro para o buffer de memória alocado anteriormente. Esse valor nunca será um ponteiro nulo.

*memoryTypeId*   \_In\_\
Tipo: uint32\_t

Um identificador opaco que representa a categoria interna do Game Chat 2 para a memória que está sendo liberada.

<a id="remarksSection" />

## Comentários

Essa função representa um retorno de chamada personalizado que, se disponível, é invocado sempre que um buffer de memória alocado anteriormente não é mais necessário para a biblioteca do Game Chat 2 e pode ser liberado. Esse retorno de chamada é opcional e pode ser instalado chamando o método [chat\_manager::set\_memory\_callbacks](/pt-BR/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks). Se não houver retornos de chamada personalizados instalados, o Game Chat 2 usará suas próprias funções padrão para alocar e liberar memória. Você pode usar o método [chat\_manager::get\_memory\_callbacks](/pt-BR/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_memory_callbacks) para determinar se o seu aplicativo está usando funções padrão ou personalizadas para alocar e liberar memória.

<Note>Se você quiser usar funções personalizadas para alocar e liberar memória, deverá implementar um conjunto correspondente de funções [game\_chat\_allocate\_memory\_callback](/pt-BR/reference/chat/gamechat2/functions/game_chat_allocate_memory_callback) e `game_chat_free_memory_callback`. Não é possível misturar funções personalizadas e padrão para alocar e liberar memória.</Note>

Esse retorno de chamada é invocado sempre que a biblioteca do Game Chat 2 termina de usar um buffer de memória retornado anteriormente pelo [game\_chat\_allocate\_memory\_callback](/pt-BR/reference/chat/gamechat2/functions/game_chat_allocate_memory_callback) correspondente do aplicativo e indica que o aplicativo pode liberar o buffer de memória.

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** GameChat2.h

**Plataformas com suporte:** Windows, consoles da família XBOX One e consoles XBOX Series

<a id="seealsoSection" />

## Confira também

[Introdução ao Game Chat 2](/pt-BR/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_manager](/pt-BR/reference/chat/gamechat2/classes/chat_manager/chat_manager)\
[Membros do GameChat2](/pt-BR/reference/chat/gamechat2/gamechat2_members)


## Related topics

- [game_chat_free_memory_callback](/reference/chat/gamechat2/functions/game_chat_free_memory_callback.md)
- [chat_manager::get_memory_callbacks](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_memory_callbacks.md)
- [chat_manager::set_memory_callbacks](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_memory_callbacks.md)
