SWDEV-482692, SWDEV-485802, SWDEV-485489 - Handle refcounts owned by graph for user objects.

Change-Id: Ic739ab1ec5d3dc3143e3ae70f9591922bc0e3d9f
This commit is contained in:
Jaydeep Patel
2024-09-04 15:11:46 +00:00
committato da Jaydeepkumar Patel
parent 164cbcc531
commit e74ac6f580
3 ha cambiato i file con 64 aggiunte e 11 eliminazioni
+5 -2
Vedi File
@@ -357,9 +357,12 @@ Graph* Graph::clone(std::unordered_map<Node, Node>& clonedNodes) const {
}
clonedNodes[node]->SetDependencies(clonedDependencies);
}
for (auto userObj : graphUserObj_) {
userObj->retain();
for (auto& userObj : graphUserObj_) {
userObj.first->retain();
newGraph->graphUserObj_.insert(userObj);
// Clone graph should have its separate graph owned ref count = 1
newGraph->graphUserObj_[userObj.first] = 1;
userObj.first->owning_graphs_.insert(newGraph);
}
// Clone the root nodes to the new graph
if (roots_.size() > 0) {