Fixed a memory leak and a wrong memory free call.

This commit is contained in:
Juergen Schmied 2002-07-16 01:18:35 +00:00 committed by Alexandre Julliard
parent 41fc7e5d55
commit c38342a97b
2 changed files with 7 additions and 3 deletions

View file

@ -2384,7 +2384,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
tmpFolder->m_iIndent++;
}
tmpFolder->pidlItem = COMDLG32_PIDL_ILClone(pidl); /* FIXME: memory leak*/
tmpFolder->pidlItem = COMDLG32_PIDL_ILClone(pidl);
if(tmpFolder->m_iIndent > liInfos->iMaxIndentation)
liInfos->iMaxIndentation = tmpFolder->m_iIndent;
@ -2420,6 +2420,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
return iItemID;
}
COMDLG32_SHFree( tmpFolder->pidlItem );
MemFree( tmpFolder );
return -1;

View file

@ -228,7 +228,7 @@ ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
if (!--(This->ref))
{
HeapFree(GetProcessHeap(),0, This);
COMDLG32_SHFree(This);
TRACE("-- destroyed\n");
return 0;
}
@ -306,7 +306,10 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
ICOM_THIS(IShellBrowserImpl, iface);
TRACE("(%p)(%p,0x%08x)\n", This, pidl, wFlags);
TRACE("(%p)(pidl=%p,flags=0x%08x(%s))\n", This, pidl, wFlags,
(wFlags & SBSP_RELATIVE) ? "SBSP_RELATIVE" :
(wFlags & SBSP_PARENT) ? "SBSP_PARENT" :
(wFlags & SBSP_ABSOLUTE) ? "SBSP_ABSOLUTE" : "SBPS_????");
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);