dll/win32/shell32/CDefView.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index a152ac6c263..84ef4b780bf 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -1309,6 +1309,13 @@ HRESULT CDefView::FillFileMenu() HMENU hFileMenu = GetSubmenuByID(m_hMenu, FCIDM_MENU_FILE); if (!hFileMenu) return E_FAIL; + + /* Release cached IContextMenu */ + if (m_pCM) + { + IUnknown_SetSite(m_pCM, NULL); + m_pCM.Release(); + } /* Cleanup the items added previously */ for (int i = GetMenuItemCount(hFileMenu) - 1; i >= 0; i--) @@ -1326,6 +1333,7 @@ HRESULT CDefView::FillFileMenu() if (FAILED_UNEXPECTEDLY(hr)) return hr; + HMENU hmenu = CreatePopupMenu(); hr = m_pCM->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0);