[SHELL32]
authorDavid Quintana <gigaherz@gmail.com>
Tue, 19 Aug 2014 22:30:12 +0000 (22:30 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Tue, 19 Aug 2014 22:30:12 +0000 (22:30 +0000)
* Giannis found another similar case of double-releasing.

svn path=/branches/shell-experiments/; revision=63907

dll/win32/shell32/folders/fs.cpp

index d5d409e..1bd214a 100644 (file)
@@ -1058,7 +1058,7 @@ HRESULT WINAPI CFSFolder::DeleteItems(UINT cidl, LPCITEMIDLIST *apidl)
 HRESULT WINAPI CFSFolder::CopyItems(IShellFolder * pSFFrom, UINT cidl,
                                     LPCITEMIDLIST * apidl, bool bCopy)
 {
-    IPersistFolder2 *ppf2 = NULL;
+    CComPtr<IPersistFolder2> ppf2 = NULL;
     WCHAR szSrcPath[MAX_PATH];
     WCHAR szTargetPath[MAX_PATH];
     SHFILEOPSTRUCTW op;
@@ -1076,10 +1076,8 @@ HRESULT WINAPI CFSFolder::CopyItems(IShellFolder * pSFFrom, UINT cidl,
         hr = ppf2->GetCurFolder(&pidl);
         if (FAILED(hr))
         {
-            ppf2->Release();
             return hr;
         }
-        ppf2->Release();
 
         hr = pSFFrom->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strRet);
         if (FAILED(hr))
@@ -1113,7 +1111,6 @@ HRESULT WINAPI CFSFolder::CopyItems(IShellFolder * pSFFrom, UINT cidl,
                 HeapFree(GetProcessHeap(), 0, pszTargetList);
 
             SHFree(pidl);
-            ppf2->Release();
             return E_OUTOFMEMORY;
         }