clear dict when invalidating Py object to fix possible cyclic references

This commit is contained in:
wmayer
2018-08-25 21:49:57 +02:00
parent 74c0ba5fcf
commit 5572f55312
2 changed files with 9 additions and 0 deletions

View File

@@ -426,3 +426,10 @@ void PyObjectBase::untrackAttribute(const char* attr)
PyDict_DelItemString(attrDict, attr);
}
}
void PyObjectBase::clearAttributes()
{
if (attrDict) {
PyDict_Clear(attrDict);
}
}