Base: [skip ci] cleaning up modules is only needed for leak detectors

This commit is contained in:
wmayer
2022-03-20 13:39:22 +01:00
parent b3c31309d5
commit e50a475226

View File

@@ -495,9 +495,15 @@ PyObject* InterpreterSingleton::addModule(Py::ExtensionModuleBase* mod)
void InterpreterSingleton::cleanupModules()
{
for (auto it : _modules)
// This is only needed to make the address sanitizer happy
#if defined(__has_feature)
# if __has_feature(address_sanitizer)
for (auto it : _modules) {
delete it;
}
_modules.clear();
# endif
#endif
}
void InterpreterSingleton::addType(PyTypeObject* Type,PyObject* Module, const char * Name)