Skip to content

Commit 9c6fadb

Browse files
ge0rdiXenHat
authored andcommitted
Fix for recent Windows Insider builds (#11) (#33)
CMenuContainer object was not destroyed when Start Menu window was closed. It was referenced by IFrameworkInputPane::AdviseWithHWND call (to be able to receive input pane notifications). The problem was that dereferencing (IFrameworkInputPane::Unadvise) was called from CMenuContainer destructor that is called only when object's refcount goes to zero. In previous Windows versions it somehow worked, because for some reason CMenuContainer object was no longer referenced when its window was destroyed. Apparently there was some change in IFrameworkInputPane handling in recent Windows builds (starting with 17692). To fix the issue we have to call IFrameworkInputPane::Unadvise() when CMenuContainer's window is about to be destroyed.
1 parent 8a5ad15 commit 9c6fadb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ClassicStartSrc/ClassicStartMenu/ClassicStartMenuDLL/MenuContainer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,6 @@ CMenuContainer::~CMenuContainer( void )
770770
if (m_SearchIcons)
771771
DeleteObject(m_SearchIcons);
772772
if (m_pProgramsTree) m_pProgramsTree->Release();
773-
774-
if (s_pFrameworkInputPane && m_InputCookie)
775-
s_pFrameworkInputPane->Unadvise(m_InputCookie);
776773
}
777774

778775
void CMenuContainer::AddFirstFolder( IShellItem *pFolder, std::vector<MenuItem> &items, int options )
@@ -6215,6 +6212,10 @@ LRESULT CMenuContainer::OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
62156212
CloseThemeData(m_ScrollTheme);
62166213
m_ScrollTheme=NULL;
62176214
}
6215+
6216+
if (s_pFrameworkInputPane && m_InputCookie)
6217+
s_pFrameworkInputPane->Unadvise(m_InputCookie);
6218+
62186219
return 0;
62196220
}
62206221

0 commit comments

Comments
 (0)