Fix some memory leak in MLIRContext with respect to registered types/attributes interfaces

Differential Revision: https://reviews.llvm.org/D83618
This commit is contained in:
Mehdi Amini 2020-07-11 20:05:28 +00:00
parent 47872adf6a
commit 3b04af4d84

View file

@ -331,6 +331,12 @@ public:
public:
MLIRContextImpl() : identifiers(identifierAllocator) {}
~MLIRContextImpl() {
for (auto typeMapping : registeredTypes)
typeMapping.second->~AbstractType();
for (auto attrMapping : registeredAttributes)
attrMapping.second->~AbstractAttribute();
}
};
} // end namespace mlir