mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Merge pull request #15830 from jherico/fix/bugz-771
BUGZ-771: Prevent duplicates from accumulating in EntityTree::_needsParentFixup
This commit is contained in:
commit
71fb1183be
1 changed files with 13 additions and 1 deletions
|
@ -2121,9 +2121,10 @@ void EntityTree::fixupNeedsParentFixups() {
|
|||
_needsParentFixup.clear();
|
||||
}
|
||||
|
||||
std::unordered_set<QUuid> seenEntityIds;
|
||||
QMutableVectorIterator<EntityItemWeakPointer> iter(entitiesToFixup);
|
||||
while (iter.hasNext()) {
|
||||
EntityItemWeakPointer entityWP = iter.next();
|
||||
const auto& entityWP = iter.next();
|
||||
EntityItemPointer entity = entityWP.lock();
|
||||
if (!entity) {
|
||||
// entity was deleted before we found its parent
|
||||
|
@ -2131,6 +2132,17 @@ void EntityTree::fixupNeedsParentFixups() {
|
|||
continue;
|
||||
}
|
||||
|
||||
const auto id = entity->getID();
|
||||
// BUGZ-771 some entities seem to never be removed by the below logic and further seem to accumulate dupes within the _needsParentFixup list
|
||||
// This block ensures that duplicates are removed from entitiesToFixup before it's re-appended to _needsParentFixup
|
||||
if (0 != seenEntityIds.count(id)) {
|
||||
// Entity was duplicated inside entitiesToFixup
|
||||
iter.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
seenEntityIds.insert(id);
|
||||
|
||||
entity->requiresRecalcBoxes();
|
||||
bool queryAACubeSuccess { false };
|
||||
bool maxAACubeSuccess { false };
|
||||
|
|
Loading…
Reference in a new issue