[Libreoffice-commits] core.git: framework/source

Maxim Monastirsky momonasmon at gmail.com
Thu Jan 28 15:15:16 PST 2016


 framework/source/uielement/resourcemenucontroller.cxx |   20 ++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 6402164182865d7644d2e93158a23e12a6da3926
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Jan 29 00:40:36 2016 +0200

    tdf#97411 ResourceMenuController: Don't forget to dispose MenuBarManager
    
    Change-Id: Ib41952dae6bcca80436355fa5a0707e671fd3698

diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx
index a626e35..581c227 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -175,7 +175,11 @@ void ResourceMenuController::updatePopupMenu()
     }
 
     // Clear previous content.
-    m_xMenuBarManager.clear();
+    if ( m_xMenuBarManager.is() )
+    {
+        m_xMenuBarManager->dispose();
+        m_xMenuBarManager.clear();
+    }
     resetPopupMenu( m_xPopupMenu );
     m_nNewMenuId = 1;
 
@@ -240,7 +244,7 @@ void ResourceMenuController::itemActivated( const css::awt::MenuEvent& /*rEvent*
         VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
         css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( m_xFrame, css::uno::UNO_QUERY );
         m_xMenuBarManager.set( new framework::MenuBarManager(
-            m_xContext, m_xFrame, m_xURLTransformer, xDispatchProvider, m_aModuleName, pAwtMenu->GetMenu(), true, true, !m_bContextMenu && !m_bInToolbar ) );
+            m_xContext, m_xFrame, m_xURLTransformer, xDispatchProvider, m_aModuleName, pAwtMenu->GetMenu(), false, true, !m_bContextMenu && !m_bInToolbar ) );
     }
 }
 
@@ -278,8 +282,12 @@ void ResourceMenuController::disposing( const css::lang::EventObject& rEvent )
         m_xModuleConfigManager.clear();
     else
     {
+        if ( m_xMenuBarManager.is() )
+        {
+            m_xMenuBarManager->dispose();
+            m_xMenuBarManager.clear();
+        }
         svt::PopupMenuControllerBase::disposing( rEvent );
-        m_xMenuBarManager.clear();
     }
 }
 
@@ -295,8 +303,12 @@ void ResourceMenuController::disposing()
 
     m_xConfigManager.clear();
     m_xModuleConfigManager.clear();
-    m_xMenuBarManager.clear();
     m_xMenuContainer.clear();
+    if ( m_xMenuBarManager.is() )
+    {
+        m_xMenuBarManager->dispose();
+        m_xMenuBarManager.clear();
+    }
 
     svt::PopupMenuControllerBase::disposing();
 }


More information about the Libreoffice-commits mailing list