forked from OSchip/llvm-project
Attempt to fix Orc JIT test timeouts
I think there are some destruction ordering issues here. The ShouldDelete map seems to be getting destroyed before the shared_ptr deleter lambda accesses it. In any case, this avoids inserting elements into the map during shutdown. llvm-svn: 306736
This commit is contained in:
parent
837c110cb1
commit
f03096b3c3
|
@ -193,9 +193,9 @@ public:
|
||||||
}
|
}
|
||||||
auto *MPtr = M.release();
|
auto *MPtr = M.release();
|
||||||
ShouldDelete[MPtr] = true;
|
ShouldDelete[MPtr] = true;
|
||||||
auto Deleter =
|
auto Deleter = [this](Module *Mod) {
|
||||||
[this](Module *Mod) {
|
auto I = ShouldDelete.find(Mod);
|
||||||
if (ShouldDelete[Mod])
|
if (I != ShouldDelete.end() && I->second)
|
||||||
delete Mod;
|
delete Mod;
|
||||||
};
|
};
|
||||||
LocalModules.push_back(std::shared_ptr<Module>(MPtr, std::move(Deleter)));
|
LocalModules.push_back(std::shared_ptr<Module>(MPtr, std::move(Deleter)));
|
||||||
|
|
Loading…
Reference in New Issue