Commit d3a034e3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Release cached desktop folder on process detach.

parent 1f92df77
......@@ -1281,6 +1281,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
if (fImpLoad) break;
SIC_Destroy();
FreeChangeNotifications();
release_desktop_folder();
release_typelib();
break;
}
......
......@@ -230,5 +230,6 @@ BOOL AddToEnumList(IEnumIDListImpl *list, LPITEMIDLIST pidl) DECLSPEC_HIDDEN;
BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags) DECLSPEC_HIDDEN;
void release_typelib(void) DECLSPEC_HIDDEN;
void release_desktop_folder(void) DECLSPEC_HIDDEN;
#endif
......@@ -57,7 +57,6 @@ WINE_DEFAULT_DEBUG_CHANNEL (shell);
/* Undocumented functions from shdocvw */
extern HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl);
/***********************************************************************
* Desktopfolder implementation
*/
......@@ -75,6 +74,8 @@ typedef struct {
BOOL fAcceptFmt; /* flag for pending Drop */
} IDesktopFolderImpl;
static IDesktopFolderImpl *cached_sf;
static inline IDesktopFolderImpl *impl_from_IShellFolder2(IShellFolder2 *iface)
{
return CONTAINING_RECORD(iface, IDesktopFolderImpl, IShellFolder2_iface);
......@@ -934,13 +935,20 @@ static const IPersistFolder2Vtbl vt_IPersistFolder2 =
ISF_Desktop_IPersistFolder2_fnGetCurFolder
};
void release_desktop_folder(void)
{
if (!cached_sf) return;
SHFree(cached_sf->pidlRoot);
SHFree(cached_sf->sPathTarget);
LocalFree(cached_sf);
}
/**************************************************************************
* ISF_Desktop_Constructor
*/
HRESULT WINAPI ISF_Desktop_Constructor (
IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
static IDesktopFolderImpl *cached_sf;
WCHAR szMyPath[MAX_PATH];
TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
......
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