1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Revert part of r193291, restoring the deletion of loaded objects.

Without this, customers of the MCJIT were leaking memory like crazy.

It's not really clear what the *right* memory management is here, so I'm
not trying to add lots of tests or other logic, just trying to get us
back to a better baseline. I'll follow up on the original commit to
figure out the right path forward.

llvm-svn: 193323
This commit is contained in:
Chandler Carruth 2013-10-24 09:52:56 +00:00
parent 420889afe2
commit db08771049

View File

@ -76,6 +76,15 @@ MCJIT::~MCJIT() {
//
Modules.clear();
Dyld.deregisterEHFrames();
LoadedObjectMap::iterator it, end = LoadedObjects.end();
for (it = LoadedObjects.begin(); it != end; ++it) {
ObjectImage *Obj = it->second;
if (Obj) {
NotifyFreeingObject(*Obj);
delete Obj;
}
}
LoadedObjects.clear();
delete TM;
}