PartyManager::Cleanup

Immediately reclaims all resources associated with all Party library objects.

Syntax

PartyError Cleanup(  
)  

Parameters

Return value

PartyError

c_partyErrorSuccess if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via GetErrorMessage().

Remarks

If local users were participating in a PartyNetwork, they're removed ungracefully (it appears to remote devices as if network connectivity to this device is lost), so best practice is to call PartyNetwork::LeaveNetwork() first on all networks returned from a call to GetNetworks() and wait for the corresponding PartyLeaveNetworkCompletedStateChange to have the local users exit any existing PartyNetworks gracefully.

This method isn't thread-safe and may not be called concurrently with other non-static Party library methods. After calling this method, all Party library state is invalidated.

Titles using the Microsoft Game Core version of the Party library must listen for app state notifications via the RegisterAppStateChangeNotification API. When the app is suspended, the title must call PartyManager::Cleanup(). When the app is resumed, the title must wait for the Game Core networking stack to be ready and then reinitialize the Party library by calling PartyManager::Initialize().

Every call to Initialize() should have a corresponding Cleanup() call.

Requirements

Header: Party.h

See also

PartyManager
PartyManager::Initialize
PartyNetwork::LeaveNetwork
PartyManager::GetNetworks