A THEME_FILE struct and four global ATOMs are leaked when unloading uxtheme.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/uxtheme/main.c | 3 +++ dlls/uxtheme/system.c | 10 ++++++++++ dlls/uxtheme/uxthemedll.h | 1 + 3 files changed, 14 insertions(+)
diff --git a/dlls/uxtheme/main.c b/dlls/uxtheme/main.c index 5e5610a1f84..0b852b06fc7 100644 --- a/dlls/uxtheme/main.c +++ b/dlls/uxtheme/main.c @@ -39,6 +39,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) DisableThreadLibraryCalls(hInstDLL); UXTHEME_InitSystem(hInstDLL); break; + case DLL_PROCESS_DETACH: + UXTHEME_UninitSystem(); + break; } return TRUE; } diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index b18794740a8..dcd2a660042 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -509,6 +509,16 @@ void UXTHEME_InitSystem(HINSTANCE hInst) UXTHEME_LoadTheme(); }
+void UXTHEME_UninitSystem(void) +{ + MSSTYLES_SetActiveTheme(NULL, FALSE); + + GlobalDeleteAtom(atWindowTheme); + GlobalDeleteAtom(atSubAppName); + GlobalDeleteAtom(atSubIdList); + GlobalDeleteAtom(atDialogThemeEnabled); +} + /*********************************************************************** * IsAppThemed (UXTHEME.@) */ diff --git a/dlls/uxtheme/uxthemedll.h b/dlls/uxtheme/uxthemedll.h index fee152c9c34..fdf529b422a 100644 --- a/dlls/uxtheme/uxthemedll.h +++ b/dlls/uxtheme/uxthemedll.h @@ -95,6 +95,7 @@ HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown, ParseThemeIniFileProc callback, LPVOID lpData) DECLSPEC_HIDDEN;
extern void UXTHEME_InitSystem(HINSTANCE hInst) DECLSPEC_HIDDEN; +extern void UXTHEME_UninitSystem(void) DECLSPEC_HIDDEN;
/* No alpha blending */ #define ALPHABLEND_NONE 0