Commit 81e15c5c authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Only release object if we actually got it.

parent 86cb1cec
......@@ -231,16 +231,18 @@ static void FillTreeView(IShellFolder * lpsf, LPITEMIDLIST pidl, HTREEITEM hPar
{
hr = IShellFolder_BindToObject(lpsf,pidlTemp,NULL,&IID_IShellFolder,(LPVOID*)&pSFChild);
if (SUCCEEDED(hr))
{
hr = IShellFolder_EnumObjects(pSFChild, hwnd, BrowseFlagsToSHCONTF(lpBrowseInfo->ulFlags), &pEnumIL);
if (SUCCEEDED(hr))
{
if ((IEnumIDList_Skip(pEnumIL, 1) != S_OK) || FAILED(IEnumIDList_Reset(pEnumIL)))
{
IEnumIDList_Release(pEnumIL);
pEnumIL = NULL;
}
}
IShellFolder_Release(pSFChild);
if (SUCCEEDED(hr))
{
if ((IEnumIDList_Skip(pEnumIL, 1) != S_OK) || FAILED(IEnumIDList_Reset(pEnumIL)))
{
IEnumIDList_Release(pEnumIL);
pEnumIL = NULL;
}
}
IShellFolder_Release(pSFChild);
}
}
if (!(hPrev = InsertTreeViewItem(lpsf, pidlTemp, pidl, pEnumIL, hParent)))
......
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