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
37 // remove ownership and dirty all the tree elements that contain the it37 // remove ownership and dirty all the tree elements that contain the it
38 entity->clearSimulationOwnership();38 entity->clearSimulationOwnership();
39 entity->markAsChangedOnServer();39 entity->markAsChangedOnServer();
40 DirtyOctreeElementOperator op(entity->getElement());40 if (auto element = entity->getElement()) {
41 getEntityTree()->recurseTreeWithOperator(&op);41 auto tree = getEntityTree();
42 tree->withReadLock([&] {
43 DirtyOctreeElementOperator op(element);
44 tree->recurseTreeWithOperator(&op);
45 });
46 }
42 } else {47 } else {
43 ++itemItr;48 ++itemItr;
44 }49 }

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