mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-27 15:29:51 +00:00
llvm-rtdyld: Don't leak memory managers.
Dyld never outlives MemMgr, just put both on the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
527692a594
commit
a757e93626
@ -124,8 +124,8 @@ static int printLineInfoForInput() {
|
||||
InputFileList.push_back("-");
|
||||
for(unsigned i = 0, e = InputFileList.size(); i != e; ++i) {
|
||||
// Instantiate a dynamic linker.
|
||||
TrivialMemoryManager *MemMgr = new TrivialMemoryManager;
|
||||
RuntimeDyld Dyld(MemMgr);
|
||||
TrivialMemoryManager MemMgr;
|
||||
RuntimeDyld Dyld(&MemMgr);
|
||||
|
||||
// Load the input memory buffer.
|
||||
OwningPtr<MemoryBuffer> InputBuffer;
|
||||
@ -180,8 +180,8 @@ static int printLineInfoForInput() {
|
||||
|
||||
static int executeInput() {
|
||||
// Instantiate a dynamic linker.
|
||||
TrivialMemoryManager *MemMgr = new TrivialMemoryManager;
|
||||
RuntimeDyld Dyld(MemMgr);
|
||||
TrivialMemoryManager MemMgr;
|
||||
RuntimeDyld Dyld(&MemMgr);
|
||||
|
||||
// If we don't have any input files, read from stdin.
|
||||
if (!InputFileList.size())
|
||||
|
Loading…
Reference in New Issue
Block a user