Tests: IO, fixed a memory leak in the USDHierarchyIteratorTest
No functional changes to Blender.
This commit is contained in:
parent
269c184ac9
commit
5904953d22
|
@ -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()
|
||||
|
|
|
@ -71,6 +71,7 @@ class TestingHierarchyIterator : public AbstractHierarchyIterator {
|
|||
}
|
||||
virtual ~TestingHierarchyIterator()
|
||||
{
|
||||
release_writers();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue