Tests: IO, fixed a memory leak in the USDHierarchyIteratorTest

No functional changes to Blender.
This commit is contained in:
Sybren A. Stüvel 2020-07-21 14:10:34 +02:00
parent 269c184ac9
commit 5904953d22
2 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,12 @@ AbstractHierarchyIterator::AbstractHierarchyIterator(Depsgraph *depsgraph)
AbstractHierarchyIterator::~AbstractHierarchyIterator()
{
/* release_writers() cannot be called here directly, as it calls into the pure-virtual
* release_writer() function. By the time this destructor is called, the subclass that implements
* that pure-virtual function is already destructed. */
BLI_assert(
writers_.empty() ||
!"release_writers() should be called before the AbstractHierarchyIterator goes out of scope");
}
void AbstractHierarchyIterator::iterate_and_write()

View File

@ -71,6 +71,7 @@ class TestingHierarchyIterator : public AbstractHierarchyIterator {
}
virtual ~TestingHierarchyIterator()
{
release_writers();
}
protected: