Skip to content

Commit

Permalink
Fix possible missing unlock of env_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
sapier authored and sapier committed Feb 12, 2014
1 parent 89f7dc1 commit ded5f8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/server.cpp
Expand Up @@ -4222,9 +4222,10 @@ void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason)
<<" List of players: "<<os.str()<<std::endl;
}
}
m_env_mutex.Lock();
m_clients.DeleteClient(peer_id);
m_env_mutex.Unlock();
{
JMutexAutoLock env_lock(m_env_mutex);
m_clients.DeleteClient(peer_id);
}
}

// Send leave chat message to all remaining clients
Expand Down

0 comments on commit ded5f8b

Please sign in to comment.