fix parent loop crash

This commit is contained in:
SamGondelman 2019-02-22 14:26:15 -08:00
parent a63f3e76c8
commit 081e62a647
2 changed files with 8 additions and 3 deletions

View file

@ -1420,11 +1420,16 @@ QUuid SpatiallyNestable::getEditSenderID() {
return editSenderID;
}
void SpatiallyNestable::bumpAncestorChainRenderableVersion() const {
void SpatiallyNestable::bumpAncestorChainRenderableVersion(int depth) const {
if (depth > MAX_PARENTING_CHAIN_SIZE) {
breakParentingLoop();
return;
}
_ancestorChainRenderableVersion++;
bool success = false;
auto parent = getParentPointer(success);
if (success && parent) {
parent->bumpAncestorChainRenderableVersion();
parent->bumpAncestorChainRenderableVersion(depth + 1);
}
}

View file

@ -221,7 +221,7 @@ public:
bool hasGrabs();
virtual QUuid getEditSenderID();
void bumpAncestorChainRenderableVersion() const;
void bumpAncestorChainRenderableVersion(int depth = 0) const;
protected:
QUuid _id;