mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:23:33 +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*/ {
|
EntityTreeElementPointer EntityTree::getContainingElement(const EntityItemID& entityItemID) /*const*/ {
|
||||||
QReadLocker locker(&_entityMapLock);
|
EntityItemPointer entity;
|
||||||
EntityItemPointer entity = _entityMap.value(entityItemID);
|
{
|
||||||
|
QReadLocker locker(&_entityMapLock);
|
||||||
|
entity = _entityMap.value(entityItemID);
|
||||||
|
}
|
||||||
if (entity) {
|
if (entity) {
|
||||||
return entity->getElement();
|
return entity->getElement();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue