From 433639f783b3b36f708a0283f70fe137198b92bb Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sat, 10 Nov 2007 16:06:35 +0000 Subject: [PATCH] ole32: Free the memory associated with the open DLL list on unloading of ole32. --- dlls/ole32/compobj.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 4bd8e81a7e3..154ebc53c42 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -965,6 +965,21 @@ static void COMPOBJ_DllList_ReleaseRef(OpenDll *entry, BOOL free_entry) } } +/* frees memory associated with active dll list */ +static void COMPOBJ_DllList_Free(void) +{ + OpenDll *entry, *cursor2; + EnterCriticalSection(&csOpenDllList); + LIST_FOR_EACH_ENTRY_SAFE(entry, cursor2, &openDllList, OpenDll, entry) + { + list_remove(&entry->entry); + + HeapFree(GetProcessHeap(), 0, entry->library_name); + HeapFree(GetProcessHeap(), 0, entry); + } + LeaveCriticalSection(&csOpenDllList); +} + /****************************************************************************** * CoBuildVersion [OLE32.@] * CoBuildVersion [COMPOBJ.1] @@ -3721,6 +3736,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) OLEDD_UnInitialize(); COMPOBJ_UninitProcess(); RPC_UnregisterAllChannelHooks(); + COMPOBJ_DllList_Free(); OLE32_hInstance = 0; break;