From 1ed73fae13b8645a47a224fb6d2814dcaf297d62 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 16 May 2003 20:16:56 +0000 Subject: [PATCH] Call the user signal proc for exe modules too, to avoid duplicating the module cleanup code. --- dlls/kernel/kernel32.spec | 1 - dlls/user/user_main.c | 15 --------------- loader/ne/module.c | 10 ++++------ 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec index 68ade1c7d39..c38dc44be6e 100644 --- a/dlls/kernel/kernel32.spec +++ b/dlls/kernel/kernel32.spec @@ -1088,7 +1088,6 @@ @ stdcall GetModuleFileName16(long ptr long) @ stdcall GetModuleHandle16(str) @ stdcall GetModuleName16(long ptr long) -@ stdcall GetModuleUsage16(long) @ stdcall GetSelectorBase(long) @ stdcall GetSelectorLimit16(long) @ stdcall GetThreadQueue16(long) diff --git a/dlls/user/user_main.c b/dlls/user/user_main.c index b8aa63f2260..24866d27153 100644 --- a/dlls/user/user_main.c +++ b/dlls/user/user_main.c @@ -292,21 +292,6 @@ static void thread_detach(void) WIN_DestroyThreadWindows( GetDesktopWindow() ); QUEUE_DeleteMsgQueue(); - if (!(NtCurrentTeb()->tibflags & TEBF_WIN32)) - { - HMODULE16 hModule = GetExePtr( MapHModuleLS(0) ); - - /* FIXME: maybe destroy menus (Windows only complains about them - * but does nothing); - */ - if (GetModuleUsage16( hModule ) <= 1) - { - /* ModuleUnload() in "Internals" */ - /* HOOK_FreeModuleHooks( hModule ); */ - CLASS_FreeModuleClasses( hModule ); - CURSORICON_FreeModuleIcons( hModule ); - } - } exiting_thread_id = 0; } diff --git a/loader/ne/module.c b/loader/ne/module.c index 9daded5b422..bc75fb7d25a 100644 --- a/loader/ne/module.c +++ b/loader/ne/module.c @@ -1282,13 +1282,11 @@ static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep ) if (call_wep && !(pModule->flags & NE_FFLAGS_WIN32)) { - if (pModule->flags & NE_FFLAGS_LIBMODULE) - { - MODULE_CallWEP( hModule ); + /* Free the objects owned by the DLL module */ + NE_CallUserSignalProc( hModule, USIG16_DLL_UNLOAD ); - /* Free the objects owned by the DLL module */ - NE_CallUserSignalProc( hModule, USIG16_DLL_UNLOAD ); - } + if (pModule->flags & NE_FFLAGS_LIBMODULE) + MODULE_CallWEP( hModule ); else call_wep = FALSE; /* We are freeing a task -> no more WEPs */ }