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 5eaf2e6387
commit f8f4cd76cc
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);
}
}