Jacek Caban : mshtml: Release typelib in PROCESS_DETACH.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Aug 2 06:23:02 CDT 2007
Module: wine
Branch: master
Commit: a39dec21e2f04c41b5ed5e671136245a367eff44
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a39dec21e2f04c41b5ed5e671136245a367eff44
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Aug 1 20:10:27 2007 +0200
mshtml: Release typelib in PROCESS_DETACH.
---
dlls/mshtml/main.c | 32 +++++++++++++++++++-------------
1 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c
index 41f32eb..9a2a4f0 100644
--- a/dlls/mshtml/main.c
+++ b/dlls/mshtml/main.c
@@ -86,6 +86,20 @@ static void thread_detach(void)
{
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) {
unsigned i;
@@ -96,14 +110,10 @@ static void thread_detach(void)
ITypeLib_Release(typelib);
}
- thread_data = get_thread_data(FALSE);
- if(!thread_data)
- return;
-
- if(thread_data->thread_hwnd)
- DestroyWindow(thread_data->thread_hwnd);
-
- mshtml_free(thread_data);
+ if(shdoclc)
+ FreeLibrary(shdoclc);
+ if(mshtml_tls)
+ TlsFree(mshtml_tls);
}
HINSTANCE get_shdoclc(void)
@@ -124,11 +134,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
hInst = hInstDLL;
break;
case DLL_PROCESS_DETACH:
- close_gecko();
- if(shdoclc)
- FreeLibrary(shdoclc);
- if(mshtml_tls)
- TlsFree(mshtml_tls);
+ process_detach();
break;
case DLL_THREAD_DETACH:
thread_detach();
More information about the wine-cvs
mailing list