Fix memory leaks in CollectionObject by making ob a weak pointer and removing prev pointer.

Something was cyclic in CollectionObject and we don't traverse backwards anyways
This commit is contained in:
Pencil Amazing
2021-11-26 22:09:06 -04:00
parent e831ecf3c2
commit 095bd67e10
3 changed files with 23 additions and 13 deletions
+1 -1
View File
@@ -325,7 +325,7 @@ void BlenderImporter::ParseSubCollection(const Blender::Scene &in, aiNode *root,
// Count number of objects
for (std::shared_ptr<CollectionObject> cur = std::static_pointer_cast<CollectionObject>(collection->gobject.first); cur; cur = cur->next) {
if (cur->ob) {
root_objects.push_back(cur->ob.get());
root_objects.push_back(cur->ob);
}
}
std::deque<Collection *> root_children;