From cf0e32066cd232db58b6cc6eba6efac39a9f32e9 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 20 Jun 2015 17:52:28 +0000 Subject: [PATCH] [SHELL32] - Also make My Computer a singleton, as shown by the CMyComputer test. With r68210 and this commit, SHFileOperation on a large number of files is approximately 3 times as fast. CORE-9839 #resolve svn path=/trunk/; revision=68212 --- reactos/dll/win32/shell32/folders/CDrivesFolder.cpp | 1 + reactos/dll/win32/shell32/folders/CDrivesFolder.h | 2 +- reactos/dll/win32/shell32/shell32.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp b/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp index 0a5fa1476ed..963f3dec110 100644 --- a/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -161,6 +161,7 @@ CDrivesFolder::CDrivesFolder() CDrivesFolder::~CDrivesFolder() { TRACE ("-- destroying IShellFolder(%p)\n", this); + ASSERT(_CreatorClass::IsTerminated()); SHFree(pidlRoot); } diff --git a/reactos/dll/win32/shell32/folders/CDrivesFolder.h b/reactos/dll/win32/shell32/folders/CDrivesFolder.h index 53752dde5f7..fe6c6f84a28 100644 --- a/reactos/dll/win32/shell32/folders/CDrivesFolder.h +++ b/reactos/dll/win32/shell32/folders/CDrivesFolder.h @@ -69,7 +69,7 @@ class CDrivesFolder : virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST * pidl); DECLARE_REGISTRY_RESOURCEID(IDR_MYCOMPUTER) - DECLARE_NOT_AGGREGATABLE(CDrivesFolder) + DECLARE_SINGLETON_NOT_AGGREGATABLE(CDrivesFolder) DECLARE_PROTECT_FINAL_CONSTRUCT() diff --git a/reactos/dll/win32/shell32/shell32.cpp b/reactos/dll/win32/shell32/shell32.cpp index 84af50d7b22..6a923c89e92 100644 --- a/reactos/dll/win32/shell32/shell32.cpp +++ b/reactos/dll/win32/shell32/shell32.cpp @@ -151,6 +151,7 @@ class CShell32Module : public CComModule public: void Term() { + CComCreatorSingleton< ATL::CComObject< CDrivesFolder > >::Term(); CComCreatorSingleton< ATL::CComObject< CDesktopFolder > >::Term(); CComModule::Term(); }