Commit a39dec21 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Release typelib in PROCESS_DETACH.

parent b2395e49
...@@ -86,6 +86,20 @@ static void thread_detach(void) ...@@ -86,6 +86,20 @@ static void thread_detach(void)
{ {
thread_data_t *thread_data; thread_data_t *thread_data;
thread_data = get_thread_data(FALSE);
if(!thread_data)
return;
if(thread_data->thread_hwnd)
DestroyWindow(thread_data->thread_hwnd);
mshtml_free(thread_data);
}
static void process_detach(void)
{
close_gecko();
if(typelib) { if(typelib) {
unsigned i; unsigned i;
...@@ -96,14 +110,10 @@ static void thread_detach(void) ...@@ -96,14 +110,10 @@ static void thread_detach(void)
ITypeLib_Release(typelib); ITypeLib_Release(typelib);
} }
thread_data = get_thread_data(FALSE); if(shdoclc)
if(!thread_data) FreeLibrary(shdoclc);
return; if(mshtml_tls)
TlsFree(mshtml_tls);
if(thread_data->thread_hwnd)
DestroyWindow(thread_data->thread_hwnd);
mshtml_free(thread_data);
} }
HINSTANCE get_shdoclc(void) HINSTANCE get_shdoclc(void)
...@@ -124,11 +134,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) ...@@ -124,11 +134,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
hInst = hInstDLL; hInst = hInstDLL;
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
close_gecko(); process_detach();
if(shdoclc)
FreeLibrary(shdoclc);
if(mshtml_tls)
TlsFree(mshtml_tls);
break; break;
case DLL_THREAD_DETACH: case DLL_THREAD_DETACH:
thread_detach(); thread_detach();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment