Opening some theme class data now also increases the reference count

of the theme file, so as long as theme class data is still opened
somewhere, the theme file won't get freed. Otherwise, it could happen
that invalid class data was used, which could lead to problems.
This commit is contained in:
Frank Richter 2005-07-05 11:45:57 +00:00 committed by Alexandre Julliard
parent 204f32eae2
commit 420d7a82da
2 changed files with 8 additions and 2 deletions

View File

@ -810,6 +810,8 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
}
if(cls) {
TRACE("Opened app %s, class %s from list %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName), debugstr_w(pszClassList));
cls->tf = tfActiveTheme;
cls->tf->dwRefCount++;
}
return cls;
}
@ -823,11 +825,12 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
* tc Theme class to close
*
* NOTES
* There is currently no need clean anything up for theme classes,
* so do nothing for now
* The MSSTYLES_CloseThemeFile decreases the refcount of the owning
* theme file and cleans it up, if needed.
*/
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
{
MSSTYLES_CloseThemeFile (tc->tf);
return S_OK;
}

View File

@ -46,8 +46,11 @@ typedef struct _THEME_PARTSTATE {
struct _THEME_PARTSTATE *next;
} THEME_PARTSTATE, *PTHEME_PARTSTATE;
struct _THEME_FILE;
typedef struct _THEME_CLASS {
HMODULE hTheme;
struct _THEME_FILE* tf;
WCHAR szAppName[MAX_THEME_APP_NAME];
WCHAR szClassName[MAX_THEME_CLASS_NAME];
PTHEME_PARTSTATE partstate;