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

Stephan Bergmann sbergman at redhat.com
Tue Nov 8 15:55:23 UTC 2016


 framework/source/uielement/toolbarmanager.cxx |   62 ++++++++++++--------------
 1 file changed, 29 insertions(+), 33 deletions(-)

New commits:
commit 991dad0a93ab6cefb2847ef1a98df87bcacd1fb1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 8 16:53:57 2016 +0100

    Clean up (calls to) ToolBarManager::RemoveControllers
    
    ...which turns out to be only called with SolarMutex locked
    
    Change-Id: I3264b0a043da7111b8ca12c59ee7a590f1a43b8e

diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index cc00fc9..26d7e50 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -401,50 +401,46 @@ throw ( RuntimeException, std::exception )
 
 void SAL_CALL ToolBarManager::disposing( const EventObject& Source ) throw ( RuntimeException, std::exception )
 {
-    {
-        SolarMutexGuard g;
-        if ( m_bDisposed )
-            return;
-    }
+    SolarMutexGuard g;
+
+    if ( m_bDisposed )
+        return;
 
     RemoveControllers();
 
+    if ( m_xDocImageManager.is() )
     {
-        SolarMutexGuard g;
-        if ( m_xDocImageManager.is() )
+        try
+        {
+            m_xDocImageManager->removeConfigurationListener(
+                Reference< XUIConfigurationListener >(
+                    static_cast< OWeakObject* >( this ), UNO_QUERY ));
+        }
+        catch (const Exception&)
         {
-            try
-            {
-                m_xDocImageManager->removeConfigurationListener(
-                    Reference< XUIConfigurationListener >(
-                        static_cast< OWeakObject* >( this ), UNO_QUERY ));
-            }
-            catch (const Exception&)
-            {
-            }
         }
+    }
 
-        if ( m_xModuleImageManager.is() )
+    if ( m_xModuleImageManager.is() )
+    {
+        try
+        {
+            m_xModuleImageManager->removeConfigurationListener(
+                Reference< XUIConfigurationListener >(
+                    static_cast< OWeakObject* >( this ), UNO_QUERY ));
+        }
+        catch (const Exception&)
         {
-            try
-            {
-                m_xModuleImageManager->removeConfigurationListener(
-                    Reference< XUIConfigurationListener >(
-                        static_cast< OWeakObject* >( this ), UNO_QUERY ));
-            }
-            catch (const Exception&)
-            {
-            }
         }
+    }
 
-        m_xDocImageManager.clear();
-        m_xModuleImageManager.clear();
+    m_xDocImageManager.clear();
+    m_xModuleImageManager.clear();
 
-        if ( Source.Source == Reference< XInterface >( m_xFrame, UNO_QUERY ))
-            m_xFrame.clear();
+    if ( Source.Source == Reference< XInterface >( m_xFrame, UNO_QUERY ))
+        m_xFrame.clear();
 
-        m_xContext.clear();
-    }
+    m_xContext.clear();
 }
 
 // XComponent
@@ -619,7 +615,7 @@ void SAL_CALL ToolBarManager::elementReplaced( const css::ui::ConfigurationEvent
 
 void ToolBarManager::RemoveControllers()
 {
-    SolarMutexGuard g;
+    DBG_TESTSOLARMUTEX();
 
     if ( m_bDisposed )
         return;


More information about the Libreoffice-commits mailing list