mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
NetPlay: Don't update mappings on leave if player had no mappings
This stops clients randomly deadlocking when a spectator leaves, as the mappings construct is not thread-safe and should not be written while the game is running.
This commit is contained in:
@ -366,7 +366,7 @@ unsigned int NetPlayServer::OnConnect(ENetPeer* socket)
|
|||||||
// called from ---NETPLAY--- thread
|
// called from ---NETPLAY--- thread
|
||||||
unsigned int NetPlayServer::OnDisconnect(const Client& player)
|
unsigned int NetPlayServer::OnDisconnect(const Client& player)
|
||||||
{
|
{
|
||||||
PlayerId pid = player.pid;
|
const PlayerId pid = player.pid;
|
||||||
|
|
||||||
if (m_is_running)
|
if (m_is_running)
|
||||||
{
|
{
|
||||||
@ -405,18 +405,18 @@ unsigned int NetPlayServer::OnDisconnect(const Client& player)
|
|||||||
if (mapping == pid)
|
if (mapping == pid)
|
||||||
{
|
{
|
||||||
mapping = -1;
|
mapping = -1;
|
||||||
|
UpdatePadMapping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdatePadMapping();
|
|
||||||
|
|
||||||
for (PadMapping& mapping : m_wiimote_map)
|
for (PadMapping& mapping : m_wiimote_map)
|
||||||
{
|
{
|
||||||
if (mapping == pid)
|
if (mapping == pid)
|
||||||
{
|
{
|
||||||
mapping = -1;
|
mapping = -1;
|
||||||
|
UpdateWiimoteMapping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdateWiimoteMapping();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user