[BROWSEUI]
authorDavid Quintana <gigaherz@gmail.com>
Thu, 23 Oct 2014 19:50:29 +0000 (19:50 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Thu, 23 Oct 2014 19:50:29 +0000 (19:50 +0000)
* Fix icon leak of the returned old icon from WM_SETICON.

[RSHELL]
* Add two debug prints (not hit).

[FILEBROWSER]
[EXPLORER-NEW]
* Free PWSTR pointers after exiting.

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

base/shell/explorer-new/explorer.c
base/shell/filebrowser/filebrowser.c
base/shell/rshell/CMenuFocusManager.cpp
dll/win32/browseui/shellbrowser.cpp

index 36980e6..fe30d62 100644 (file)
@@ -392,14 +392,22 @@ _tWinMain(IN HINSTANCE hInstance,
     if (GetShellWindow() == NULL)
         CreateShellDesktop = TRUE;
 
-    /* FIXME - initialize SSO Thread */
-
     if (!CreateShellDesktop)
     {
         EXPLORER_CMDLINE_PARSE_RESULTS parseResults = { 0 };
 
         if (SHExplorerParseCmdLine(&parseResults))
             return SHCreateFromDesktop(&parseResults);
+
+        if (parseResults.strPath)
+            SHFree(parseResults.strPath);
+
+        if (parseResults.pidlPath)
+            ILFree(parseResults.pidlPath);
+
+        if (parseResults.pidlRoot)
+            ILFree(parseResults.pidlRoot);
+
     }
 
     if (RegOpenKey(HKEY_CURRENT_USER,
index ee5f59e..0acbf2e 100644 (file)
@@ -37,5 +37,14 @@ int _tmain(int argc, _TCHAR* argv[])
         return SHCreateFromDesktop(&parseResults);
     }
 
+    if (parseResults.strPath)
+        SHFree(parseResults.strPath);
+
+    if (parseResults.pidlPath)
+        ILFree(parseResults.pidlPath);
+
+    if (parseResults.pidlRoot)
+        ILFree(parseResults.pidlRoot);
+
     return 0;
 }
index dbbfcc8..f4e758e 100644 (file)
@@ -641,6 +641,16 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL
 
 HRESULT CMenuFocusManager::PlaceHooks()
 {
+    if (m_hMsgFilterHook)
+    {
+        WARN("GETMESSAGE hook already placed!\n");
+        return S_OK;
+    }
+    if (m_hMsgFilterHook)
+    {
+        WARN("MSGFILTER hook already placed!\n");
+        return S_OK;
+    }
     if (m_current->type == TrackedMenuEntry)
     {
         TRACE("Entering MSGFILTER hook...\n");
index 1ffb0f2..ea89e17 100644 (file)
@@ -1078,8 +1078,11 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
         HICON icSmall = ImageList_GetIcon(himlSmall, indexOpen, 0);
         HICON icLarge = ImageList_GetIcon(himlLarge, indexOpen, 0);
 
-        SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall));
-        SendMessage(WM_SETICON, ICON_BIG,   reinterpret_cast<LPARAM>(icLarge));
+        HICON oldSmall = (HICON)SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall));
+        HICON oldLarge = (HICON)SendMessage(WM_SETICON, ICON_BIG,   reinterpret_cast<LPARAM>(icLarge));
+
+        DestroyIcon(oldSmall);
+        DestroyIcon(oldLarge);
     }
 
     // TODO: Update the window icon