History

Merge pull request #12571 from Atlante45/fix/es-concurrent-traversal

Fix unprotected tree traversals

Seth Alves committed 8 years ago

Commit 7f285c52 parents 7c65c9c 895023c4 files · +65 −34Browse files

Showing the changes to libraries/entities/src/SimpleEntitySimulation.cpp (1 of 4 files). Show all

Unified · Split

libraries/entities/src/SimpleEntitySimulation.cpp+7−2
@@ -37,8 +37,13 @@ void SimpleEntitySimulation::clearOwnership(const QUuid& ownerID) { · 36 unmodified lines
3737 // remove ownership and dirty all the tree elements that contain the it
3838 entity->clearSimulationOwnership();
3939 entity->markAsChangedOnServer();
40− DirtyOctreeElementOperator op(entity->getElement());
41− getEntityTree()->recurseTreeWithOperator(&op);
40+ if (auto element = entity->getElement()) {
41+ auto tree = getEntityTree();
42+ tree->withReadLock([&] {
43+ DirtyOctreeElementOperator op(element);
44+ tree->recurseTreeWithOperator(&op);
45+ });
46+ }
4247 } else {
4348 ++itemItr;
4449 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t