mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[SHELL32] Fix Assertion when opening "File" menu in MyComputer twice (#4675)
ReactOS explorer shell asserts when opening the "File" menu in MyComputer for the second time. This is due to the cached copy of IContextMenu not being released before attempting to cache it again. Fix based on the patch proposed by JIRA user I_Kill_Bugs CORE-18353 Signed-off by: I_Kill_Bugs (original patch author)
This commit is contained in:
@@ -1310,6 +1310,13 @@ HRESULT CDefView::FillFileMenu()
|
||||
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--)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user