Merge pull request #14995 from SamGondelman/parentCrash

Case 21391: Fix parent loop crash
This commit is contained in:
Shannon Romano 2019-02-25 10:01:37 -08:00 committed by GitHub
commit dc6bdfae8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 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) {
// can't break the parent chain here, because it will call setParentID, which calls this
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;