From: Benjamin Kramer Date: Sat, 3 Aug 2013 22:16:31 +0000 (+0000) Subject: llvm-rtdyld: Don't leak memory managers. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ce7708abbd44fa2a7a57fa6004f2fe27c45bc6e;p=platform%2Fupstream%2Fllvm.git llvm-rtdyld: Don't leak memory managers. Dyld never outlives MemMgr, just put both on the stack. llvm-svn: 187697 --- diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp index b68f2a0..b93ac64 100644 --- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -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 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())