mirror of
https://github.com/lubosz/overte.git
synced 2025-04-27 21:55:28 +02:00
Ensure the tree lock is always taken before the simulation lock
This commit is contained in:
parent
236e75b6c6
commit
d82333534c
2 changed files with 10 additions and 8 deletions
|
@ -380,10 +380,15 @@ void EntityServer::trackSend(const QUuid& dataID, quint64 dataLastEdited, const
|
|||
}
|
||||
|
||||
void EntityServer::trackViewerGone(const QUuid& sessionID) {
|
||||
QWriteLocker locker(&_viewerSendingStatsLock);
|
||||
_viewerSendingStats.remove(sessionID);
|
||||
{
|
||||
QWriteLocker locker(&_viewerSendingStatsLock);
|
||||
_viewerSendingStats.remove(sessionID);
|
||||
}
|
||||
|
||||
if (_entitySimulation) {
|
||||
_entitySimulation->clearOwnership(sessionID);
|
||||
_tree->withReadLock([&] {
|
||||
_entitySimulation->clearOwnership(sessionID);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,11 +38,8 @@ void SimpleEntitySimulation::clearOwnership(const QUuid& ownerID) {
|
|||
entity->clearSimulationOwnership();
|
||||
entity->markAsChangedOnServer();
|
||||
if (auto element = entity->getElement()) {
|
||||
auto tree = getEntityTree();
|
||||
tree->withReadLock([&] {
|
||||
DirtyOctreeElementOperator op(element);
|
||||
tree->recurseTreeWithOperator(&op);
|
||||
});
|
||||
DirtyOctreeElementOperator op(element);
|
||||
getEntityTree()->recurseTreeWithOperator(&op);
|
||||
}
|
||||
} else {
|
||||
++itemItr;
|
||||
|
|
Loading…
Reference in a new issue