X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSystem%2FWin32%2FDynamicLibrary.inc;fp=lib%2FSystem%2FWin32%2FDynamicLibrary.inc;h=10e64aa990c95f281120fe26efe9675d028dfa00;hb=8b8d31e3ec8c491a893307069ac123728c84782c;hp=fd2ecc813cc25f8ce592f0cbafa754353692e442;hpb=01d9a1b78d27408c519d25f896e6e40c109046ba;p=oota-llvm.git diff --git a/lib/System/Win32/DynamicLibrary.inc b/lib/System/Win32/DynamicLibrary.inc index fd2ecc813cc..10e64aa990c 100644 --- a/lib/System/Win32/DynamicLibrary.inc +++ b/lib/System/Win32/DynamicLibrary.inc @@ -88,30 +88,6 @@ extern "C" { } } -DynamicLibrary::DynamicLibrary() : handle(0) { - handle = GetModuleHandle(NULL); - OpenedHandles.push_back((HMODULE)handle); -} - -DynamicLibrary::~DynamicLibrary() { - if (handle == 0) - return; - - // GetModuleHandle() does not increment the ref count, so we must not free - // the handle to the executable. - if (handle != GetModuleHandle(NULL)) - FreeLibrary((HMODULE)handle); - handle = 0; - - for (std::vector::iterator I = OpenedHandles.begin(), - E = OpenedHandles.end(); I != E; ++I) { - if (*I == handle) { - // Note: don't use the swap/pop_back trick here. Order is important. - OpenedHandles.erase(I); - } - } -} - bool DynamicLibrary::LoadLibraryPermanently(const char *filename, std::string *ErrMsg) { if (filename) {