From: Perttu Ahola Date: Wed, 28 Mar 2012 09:51:47 +0000 (+0300) Subject: Correctly lock mutexes when the server sends MapEditEvents (could cause memory corrup... X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=14a8fa4d68b54782ac6183263414ab2bee6fcaf7;p=zefram%2Fminetest%2Fminetest_engine.git Correctly lock mutexes when the server sends MapEditEvents (could cause memory corruption) --- 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;