shell32: Fix interface leak while adding tree items.

This commit is contained in:
Nikolay Sivov 2011-01-20 01:35:25 +03:00 committed by Alexandre Julliard
parent 92dbc57a77
commit 99f0c0a16d
1 changed files with 7 additions and 3 deletions

View File

@ -414,7 +414,7 @@ static void FillTreeView( browse_info *info, IShellFolder * lpsf,
SetCapture( hwnd ); SetCapture( hwnd );
SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) ); SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) );
while (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched)) while (S_OK == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched))
{ {
ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER; ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
IEnumIDList* pEnumIL = NULL; IEnumIDList* pEnumIL = NULL;
@ -521,14 +521,18 @@ static LRESULT BrsFolder_Treeview_Expand( browse_info *info, NMTREEVIEWW *pnmtv
if (!_ILIsEmpty(lptvid->lpi)) { if (!_ILIsEmpty(lptvid->lpi)) {
r = IShellFolder_BindToObject( lptvid->lpsfParent, lptvid->lpi, 0, r = IShellFolder_BindToObject( lptvid->lpsfParent, lptvid->lpi, 0,
&IID_IShellFolder, (LPVOID *)&lpsf2 ); &IID_IShellFolder, (void**)&lpsf2 );
} else { } else {
lpsf2 = lptvid->lpsfParent; lpsf2 = lptvid->lpsfParent;
r = IShellFolder_AddRef(lpsf2); IShellFolder_AddRef(lpsf2);
r = S_OK;
} }
if (SUCCEEDED(r)) if (SUCCEEDED(r))
{
FillTreeView( info, lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem, lptvid->pEnumIL); FillTreeView( info, lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem, lptvid->pEnumIL);
IShellFolder_Release( lpsf2 );
}
/* My Computer is already sorted and trying to do a simple text /* My Computer is already sorted and trying to do a simple text
* sort will only mess things up */ * sort will only mess things up */