this patch fixes some crash in shell32, where one could release an
object even if the acquisition failed.
A+
--
Eric Pouech
Name: shlb
ChangeLog: only release object if we actually got it
License: X11
GenDate: 2003/07/01 20:17:48 UTC
ModifiedFiles: dlls/shell32/brsfolder.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/shell32/brsfolder.c,v
retrieving revision 1.45
diff -u -u -r1.45 brsfolder.c
--- dlls/shell32/brsfolder.c 6 Jun 2003 18:09:38 -0000 1.45
+++ dlls/shell32/brsfolder.c 13 Jun 2003 18:33:32 -0000
@@ -231,16 +231,18 @@
{
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)))