mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
Fix shutdown order of operations bug causing assert
P4:6666302
This commit is contained in:
@@ -2686,15 +2686,6 @@ void SteamNetworkingSocketsLowLevelDecRef()
|
||||
// might need to do stuff when we close a bunch of sockets (and WSACleanup)
|
||||
SteamNetworkingGlobalLock::SetLongLockWarningThresholdMS( "SteamNetworkingSocketsLowLevelDecRef", 500 );
|
||||
|
||||
if ( s_vecRawSockets.IsEmpty() )
|
||||
{
|
||||
s_vecRawSockets.Purge();
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertMsg( false, "Trying to close low level socket support, but we still have sockets open!" );
|
||||
}
|
||||
|
||||
// Stop the service thread, if we have one
|
||||
if ( s_pThreadSteamDatagram )
|
||||
StopSteamDatagramThread();
|
||||
@@ -2725,6 +2716,16 @@ void SteamNetworkingSocketsLowLevelDecRef()
|
||||
// Check for any leftover tasks that were queued to be run while we hold the lock
|
||||
ProcessDeferredOperations();
|
||||
|
||||
// At this point, we shouldn't have any remaining sockets
|
||||
if ( s_vecRawSockets.IsEmpty() )
|
||||
{
|
||||
s_vecRawSockets.Purge();
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertMsg( false, "Trying to close low level socket support, but we still have sockets open!" );
|
||||
}
|
||||
|
||||
// Nuke packet lagger queues and make sure we are not registered to think
|
||||
s_packetLagQueueRecv.Clear();
|
||||
s_packetLagQueueSend.Clear();
|
||||
|
||||
Reference in New Issue
Block a user