瀏覽代碼

fix deadlock

Kolja Strohm 3 年之前
父節點
當前提交
eae1cfdd7e
共有 1 個文件被更改,包括 2 次插入0 次删除
  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();
     }
 }