Skip to content

Commit 48da417

Browse files
committed
Fix asserts if CheckInitICE is run more than once.
P4:6553922
1 parent ea23be0 commit 48da417

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/steamnetworkingsockets/clientlib/steamnetworkingsockets_p2p.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,13 @@ void CSteamNetworkConnectionP2P::CheckInitICE()
484484
}
485485

486486
// Burn it into the connection config, if we inherited it, since we cannot change it
487-
// after this point
488-
m_connectionConfig.m_P2P_Transport_ICE_Enable.Set( P2P_Transport_ICE_Enable );
489-
m_connectionConfig.m_P2P_Transport_ICE_Enable.Lock();
487+
// after this point. (Note in some cases we may be running this initialization
488+
// for a second time, restarting ICE, so it might already be locked.)
489+
if ( !m_connectionConfig.m_P2P_Transport_ICE_Enable.IsLocked() )
490+
{
491+
m_connectionConfig.m_P2P_Transport_ICE_Enable.Set( P2P_Transport_ICE_Enable );
492+
m_connectionConfig.m_P2P_Transport_ICE_Enable.Lock();
493+
}
490494

491495
// Disabled?
492496
if ( P2P_Transport_ICE_Enable <= 0 )
@@ -581,7 +585,6 @@ void CSteamNetworkConnectionP2P::CheckInitICE()
581585

582586
// Set a field in the ice session summary message,
583587
// which is how we will remember that we did attempt to use ICE
584-
Assert( !m_msgICESessionSummary.has_local_candidate_types() );
585588
m_msgICESessionSummary.set_local_candidate_types( 0 );
586589
}
587590
#endif

0 commit comments

Comments
 (0)