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

# 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()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setmemorycallbacks.md) method. \
\
&#x20;The callback is invoked whenever the Party library has finished using a memory buffer previously returned by the title's corresponding [PartyAllocateMemoryCallback](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/callbacks/partyallocatememorycallback.md), so that the title can free the memory buffer.

## Requirements

**Header:** Party.h

## See also

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


## Related topics

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