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-Tag: 0.4.dev-20120408~102 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=14a8fa4d68b54782ac6183263414ab2bee6fcaf7;p=oweals%2Fminetest.git Correctly lock mutexes when the server sends MapEditEvents (could cause memory corruption) --- diff --git a/src/server.cpp b/src/server.cpp index 8c03ec880..6756e4a08 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;