diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_socketthread.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_socketthread.cpp index 5a43c219..7be55ccb 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_socketthread.cpp +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_socketthread.cpp @@ -2602,6 +2602,9 @@ static bool PollRawUDPSockets( int nMaxTimeoutMS, bool bManualPoll ) // and we assume that it will have locked the lock exactly once. AssertGlobalLockHeldExactlyOnce(); + // Clean up any sockets that were closed and marked pending destruction before polling + ProcessPendingDestroyClosedRawUDPSockets(); + // Sanity check all of our sockets are alive #ifdef DBGFLAG_ASSERT for ( CRawUDPSocketImpl *pSock: s_vecRawSockets )