mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 14:30:08 +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) {
|
void EntityServer::trackViewerGone(const QUuid& sessionID) {
|
||||||
QWriteLocker locker(&_viewerSendingStatsLock);
|
{
|
||||||
_viewerSendingStats.remove(sessionID);
|
QWriteLocker locker(&_viewerSendingStatsLock);
|
||||||
|
_viewerSendingStats.remove(sessionID);
|
||||||
|
}
|
||||||
|
|
||||||
if (_entitySimulation) {
|
if (_entitySimulation) {
|
||||||
_entitySimulation->clearOwnership(sessionID);
|
_tree->withReadLock([&] {
|
||||||
|
_entitySimulation->clearOwnership(sessionID);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,8 @@ void SimpleEntitySimulation::clearOwnership(const QUuid& ownerID) {
|
||||||
entity->clearSimulationOwnership();
|
entity->clearSimulationOwnership();
|
||||||
entity->markAsChangedOnServer();
|
entity->markAsChangedOnServer();
|
||||||
if (auto element = entity->getElement()) {
|
if (auto element = entity->getElement()) {
|
||||||
auto tree = getEntityTree();
|
DirtyOctreeElementOperator op(element);
|
||||||
tree->withReadLock([&] {
|
getEntityTree()->recurseTreeWithOperator(&op);
|
||||||
DirtyOctreeElementOperator op(element);
|
|
||||||
tree->recurseTreeWithOperator(&op);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
++itemItr;
|
++itemItr;
|
||||||
|
|
Loading…
Reference in a new issue