mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
minimize the lock context
This commit is contained in:
parent
f71ef554b7
commit
02bc9b9610
1 changed files with 5 additions and 2 deletions
|
@ -1500,8 +1500,11 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
|
|||
}
|
||||
|
||||
EntityTreeElementPointer EntityTree::getContainingElement(const EntityItemID& entityItemID) /*const*/ {
|
||||
QReadLocker locker(&_entityMapLock);
|
||||
EntityItemPointer entity = _entityMap.value(entityItemID);
|
||||
EntityItemPointer entity;
|
||||
{
|
||||
QReadLocker locker(&_entityMapLock);
|
||||
entity = _entityMap.value(entityItemID);
|
||||
}
|
||||
if (entity) {
|
||||
return entity->getElement();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue