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

# PartyFreeMemoryCallback

> A callback invoked every time a previously allocated memory buffer is no longer needed by the Party library and can be freed.

A callback invoked every time a previously allocated memory buffer is no longer needed by the Party library and can be freed.

## Syntax

```cpp theme={null}
typedef
void (*PartyFreeMemoryCallback)(  
    void* pointer,  
    uint32_t memoryTypeId  
)  
```

### Parameters

**`pointer`**   void\*\
**Post\_invalid**

A pointer to a memory buffer previously allocated. This value will never be nullptr.

**`memoryTypeId`**   uint32\_t

An opaque identifier representing the Party library internal category of memory being freed. This value should be ignored.

### Return value

Type: void

The callback does not return a value.

## Remarks

This callback is optionally installed using the [PartyManager::SetMemoryCallbacks()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setmemorycallbacks) method. <br /><br /> The callback is invoked whenever the Party library has finished using a memory buffer previously returned by the title's corresponding [PartyAllocateMemoryCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyallocatememorycallback), so that the title can free the memory buffer.

## Requirements

**Header:** Party.h

## See also

[Party members](/services/playfab/multiplayer/networking/reference/party_members)\
[PartyAllocateMemoryCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyallocatememorycallback)\
[PartyManager::SetMemoryCallbacks](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setmemorycallbacks)\
[PartyManager::GetMemoryCallbacks](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getmemorycallbacks)


## Related topics

- [PartyAllocateMemoryCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyallocatememorycallback.md)
- [PartyManager::SetMemoryCallbacks](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setmemorycallbacks.md)
- [PartyManager::GetMemoryCallbacks](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getmemorycallbacks.md)
- [PartyXblManager::SetMemoryCallbacks](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_setmemorycallbacks.md)
- [PartyXblManager::GetMemoryCallbacks](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getmemorycallbacks.md)
