game_chat_free_memory_callback

Represents a callback invoked every time a previously-allocated memory buffer is no longer needed by the Game Chat 2 library and can be freed.

Syntax

typedef  
void  
(game_chat_callback * game_chat_free_memory_callback)(  
    _In_ _Post_invalid_ void * pointer,  
    _In_ uint32_t memoryTypeId  
    );  

Parameters

pointer   _In_ _Post_invalid_
Type: void*

The pointer to the memory buffer previously allocated. This value will never be a null pointer.

memoryTypeId   _In_
Type: uint32_t

An opaque identifier that represents the Game Chat 2 internal category for the memory being freed.

Remarks

This function represents a custom callback that, if available, is invoked every time a previously-allocated memory buffer is no longer needed by the Game Chat 2 library and can be freed. This callback is optional, and can be installed by calling the chat_manager::set_memory_callbacks method. If custom callbacks are not installed, Game Chat 2 uses its own default functions to allocate and free memory. You can use the chat_manager::get_memory_callbacks method to determine whether your app is using default or custom functions to allocate and free memory.

Note

If you want to use custom functions to allocate and free memory, you must implement a corresponding set of game_chat_allocate_memory_callback and game_chat_free_memory_callback functions. You cannot mix custom and default functions to allocate and free memory.

This callback is invoked whenever the Game Chat 2 library has finished using a memory buffer previously returned by the app's corresponding game_chat_allocate_memory_callback, and indicates that the app can free the memory buffer.

Requirements

Header: GameChat2.h

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

Intro to Game Chat 2
chat_manager
GameChat2 members