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

# PFMultiplayerUninitialize

> Reference for PFMultiplayerUninitialize, which immediately reclaims resources for all objects tied to a PlayFab Multiplayer C/C++ library instance.

Immediately reclaims all resources associated with all Multiplayer library objects.

## Syntax

```cpp theme={null}
HRESULT PFMultiplayerUninitialize(  
    PFMultiplayerHandle handle  
)  
```

### Parameters

**`handle`**   PFMultiplayerHandle\
*input not valid afterwards*

The handle of the PFMultiplayer API instance.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage.md).

## Remarks

If local users were participating in a Lobby, they are removed (it appears to remote lobby clients as if network connectivity to these users has been lost), so best practice is to call `PFLobbyLeave` on all lobbies and wait for the corresponding `PFLobbyLeaveLobbyCompletedStateChange` to have the local users exit any existing lobbies. \
\
&#x20;This method is not thread-safe and may not be called concurrently with other Multiplayer library methods. After calling this method, all Multiplayer library state is invalidated.   \
\
&#x20;Every call to [PFMultiplayerInitialize()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayerinitialize.md) should have a corresponding PFMultiplayerUninitialize() call.

## Requirements

**Header:** PFMultiplayer.h

## See also

[PFMultiplayer members](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfmultiplayer_members.md)\
[PFMultiplayerInitialize](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayerinitialize.md)


## Related topics

- [Moving from MPSD to PlayFab Multiplayer and MPA](https://docs.xbox.com/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [PFMultiplayerInitialize](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayerinitialize.md)
- [PlayFab Multiplayer C++ SDK Release Notes](https://docs.xbox.com/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayerSetThreadAffinityMask](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayersetthreadaffinitymask.md)
- [PFMultiplayer C/C++ API overview - PFMultiplayer.h](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfmultiplayer_members.md)
