Browse Source

fix deadlock

Kolja Strohm 3 năm trước cách đây
mục cha
commit
eae1cfdd7e
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      FactoryCraft/World.cpp

+ 2 - 0
FactoryCraft/World.cpp

@@ -70,8 +70,10 @@ void World::update( bool background )
     Entity* player = getCurrentPlayerEntity();
     if( player )
     {
+        renderedWorld->lock();
         for( Dimension* dim : *dimensions )
             dim->removeDistantChunks( { (int)player->getPos().x, (int)player->getPos().y }, this );
+        renderedWorld->unlock();
     }
 }