[RSHELL]
authorDavid Quintana <gigaherz@gmail.com>
Fri, 24 Oct 2014 16:03:58 +0000 (16:03 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Fri, 24 Oct 2014 16:03:58 +0000 (16:03 +0000)
* Fix HMENU leak in menu-based shell popups (and menubar).

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

base/shell/rshell/CMenuBand.cpp

index 344fdad..fbb9ba4 100644 (file)
@@ -72,6 +72,9 @@ CMenuBand::~CMenuBand()
 
     if (m_SFToolbar)
         delete m_SFToolbar;
+
+    if (m_hmenu)
+        DestroyMenu(m_hmenu);
 }
 
 HRESULT STDMETHODCALLTYPE  CMenuBand::Initialize(
@@ -129,6 +132,12 @@ HRESULT STDMETHODCALLTYPE  CMenuBand::SetMenu(
 
     BOOL created = FALSE;
 
+    if (m_hmenu)
+    {
+        DestroyMenu(m_hmenu);
+        m_hmenu = NULL;
+    }
+
     if (m_staticToolbar == NULL)
     {
         m_staticToolbar = new CMenuStaticToolbar(this);