[llvm-commits] [llvm] r80589 - /llvm/trunk/lib/System/DynamicLibrary.cpp
Torok Edwin
edwintorok at gmail.com
Mon Aug 31 09:12:30 PDT 2009
Author: edwin
Date: Mon Aug 31 11:12:29 2009
New Revision: 80589
URL: http://llvm.org/viewvc/llvm-project?rev=80589&view=rev
Log:
Fix ExplicitSymbols leak.
Modified:
llvm/trunk/lib/System/DynamicLibrary.cpp
Modified: llvm/trunk/lib/System/DynamicLibrary.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/DynamicLibrary.cpp?rev=80589&r1=80588&r2=80589&view=diff
==============================================================================
--- llvm/trunk/lib/System/DynamicLibrary.cpp (original)
+++ llvm/trunk/lib/System/DynamicLibrary.cpp Mon Aug 31 11:12:29 2009
@@ -25,6 +25,13 @@
// Collection of symbol name/value pairs to be searched prior to any libraries.
static std::map<std::string, void*> *ExplicitSymbols = 0;
+static struct ExplicitSymbolsDeleter {
+ ~ExplicitSymbolsDeleter() {
+ if (ExplicitSymbols)
+ delete ExplicitSymbols;
+ }
+} Dummy;
+
void llvm::sys::DynamicLibrary::AddSymbol(const char* symbolName,
void *symbolValue) {
if (ExplicitSymbols == 0)
More information about the llvm-commits
mailing list