From 14a8fa4d68b54782ac6183263414ab2bee6fcaf7 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 28 Mar 2012 12:51:47 +0300 Subject: [PATCH] Correctly lock mutexes when the server sends MapEditEvents (could cause memory corruption) --- src/server.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server.cpp b/src/server.cpp index 8c03ec88..6756e4a0 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1689,6 +1689,10 @@ void Server::AsyncRunStep() Send queued-for-sending map edit events. */ { + // We will be accessing the environment and the connection + JMutexAutoLock lock(m_env_mutex); + JMutexAutoLock conlock(m_con_mutex); + // Don't send too many at a time //u32 count = 0; -- 2.30.2