浏览代码

Protect lakes accessed from both zones with lock

Tomasz Zieliński 1 年之前
父节点
当前提交
6d9f83a376
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/rmg/modificators/WaterProxy.cpp

+ 1 - 0
lib/rmg/modificators/WaterProxy.cpp

@@ -219,6 +219,7 @@ bool WaterProxy::waterKeepConnection(const rmg::ZoneConnection & connection, boo
 	const auto & zoneA = connection.getZoneA();
 	const auto & zoneB = connection.getZoneB();
 
+	RecursiveLock lock(externalAccessMutex);
 	for(auto & lake : lakes)
 	{
 		if(lake.neighbourZones.count(zoneA) && lake.neighbourZones.count(zoneB))