Ver Fonte

Protect lakes accessed from both zones with lock

Tomasz Zieliński há 1 ano atrás
pai
commit
6d9f83a376
1 ficheiros alterados com 1 adições e 0 exclusões
  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))