aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-02-12 19:47:27 +0100
committersapier <Sapier at GMX dot net>2014-02-12 19:47:27 +0100
commitded5f8b1a67fbfb3bb0023b9c6d0fc305469ade4 (patch)
tree481b86d9d6be5538827bf20358f0d7057b174311
parent89f7dc1efd6b0062b4b9e5c3509c301ccadb7a13 (diff)
downloadminetest-ded5f8b1a67fbfb3bb0023b9c6d0fc305469ade4.tar.gz
minetest-ded5f8b1a67fbfb3bb0023b9c6d0fc305469ade4.tar.bz2
minetest-ded5f8b1a67fbfb3bb0023b9c6d0fc305469ade4.zip
Fix possible missing unlock of env_lock
-rw-r--r--src/server.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 66f3cc1a7..81622d625 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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