[Libreoffice-commits] core.git: accessibility/source chart2/source dbaccess/source forms/source framework/source sd/source svtools/source svx/source toolkit/source

Stephan Bergmann sbergman at redhat.com
Wed Jun 17 06:24:43 PDT 2015


 accessibility/source/extended/listboxaccessible.cxx       |    2 ++
 chart2/source/view/main/ChartView.cxx                     |    2 ++
 dbaccess/source/ui/browser/genericcontroller.cxx          |    1 +
 dbaccess/source/ui/browser/unodatbr.cxx                   |    3 +++
 forms/source/richtext/richtextcontrol.cxx                 |    2 ++
 forms/source/richtext/richtextmodel.cxx                   |    5 ++++-
 forms/source/solar/component/navbarcontrol.cxx            |   11 +++++++----
 framework/source/dispatch/closedispatcher.cxx             |    1 +
 framework/source/layoutmanager/layoutmanager.cxx          |    1 +
 sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx |    3 +++
 svtools/source/uno/unoiface.cxx                           |    1 +
 svx/source/accessibility/AccessibleShapeTreeInfo.cxx      |    4 +++-
 svx/source/fmcomp/fmgridif.cxx                            |    2 +-
 toolkit/source/awt/vclxdevice.cxx                         |    3 +++
 toolkit/source/awt/vclxgraphics.cxx                       |    3 +++
 toolkit/source/awt/vclxtoolkit.cxx                        |    2 ++
 toolkit/source/controls/unocontrol.cxx                    |    8 ++++++--
 17 files changed, 45 insertions(+), 9 deletions(-)

New commits:
commit 8e1ad966262932516b3368d9b5c44becb29524d4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 17 15:18:10 2015 +0200

    Some missing SolarMutexGuard around VclPtr acquire/release
    
    At least OutputDevice::acquire/release use a plain unguarded int and ++, --, so
    apparently rely on the SolarMutex being locked whenever they are called.  Fixed
    those places that caused "make check" to fail for me when temporarily adding
    DBG_TESTSOLARMUTEX() to OutputDevice::acquire/release.  (A recurring pattern is
    that a class fails to ensure the SolarMutex is locked around the destruction of
    non-null VclPtr members.)
    
    Change-Id: I77cba6f3908f2de1b516ce28f1c3c43b3f57a9c5

diff --git a/accessibility/source/extended/listboxaccessible.cxx b/accessibility/source/extended/listboxaccessible.cxx
index e02a1d6..e7e428c 100644
--- a/accessibility/source/extended/listboxaccessible.cxx
+++ b/accessibility/source/extended/listboxaccessible.cxx
@@ -19,6 +19,7 @@
 
 #include <accessibility/extended/listboxaccessible.hxx>
 #include <svtools/treelistbox.hxx>
+#include <vcl/svapp.hxx>
 
 namespace accessibility
 {
@@ -55,6 +56,7 @@ namespace accessibility
 
     void ListBoxAccessibleBase::disposing()
     {
+        SolarMutexGuard g;
         if ( m_pWindow )
             m_pWindow->RemoveEventListener( LINK( this, ListBoxAccessibleBase, WindowEventListener ) );
         m_pWindow = NULL;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 492f10c..be644ba 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1103,8 +1103,10 @@ GL2DRenderer::GL2DRenderer(ChartView* pView):
 
 GL2DRenderer::~GL2DRenderer()
 {
+    SolarMutexGuard g;
     if(!mbContextDestroyed && mpWindow)
         mpWindow->setRenderer(NULL);
+    mpWindow.reset();
 }
 
 void GL2DRenderer::update()
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index d7a07ff..405bb91 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -363,6 +363,7 @@ void OGenericUnoController::modified(const EventObject& aEvent) throw( RuntimeEx
 
 Reference< XWindow > SAL_CALL OGenericUnoController::getComponentWindow() throw (RuntimeException, std::exception)
 {
+    SolarMutexGuard g;
     return VCLUnoHelper::GetInterface( getView() );
 }
 
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index d8fcc49..be132dd 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -235,6 +235,9 @@ SbaTableQueryBrowser::~SbaTableQueryBrowser()
         osl_atomic_increment( &m_refCount );
         dispose();
     }
+    SolarMutexGuard g;
+    m_pTreeView.reset();
+    m_pSplitter.reset();
 }
 
 Any SAL_CALL SbaTableQueryBrowser::queryInterface(const Type& _rType) throw (RuntimeException, std::exception)
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index b775f64..c67a172 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -367,6 +367,8 @@ namespace frm
         throw (RuntimeException,
                std::exception)
     {
+        SolarMutexGuard g;
+
         if ( !GetWindow() )
         {
             VCLXWindow::setProperty( _rPropertyName, _rValue );
diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx
index 417ac6d..2bbe7f7 100644
--- a/forms/source/richtext/richtextmodel.cxx
+++ b/forms/source/richtext/richtextmodel.cxx
@@ -131,7 +131,10 @@ namespace frm
             m_pEngine->SetControlWord( nEngineControlWord );
 
             VCLXDevice* pUnoRefDevice = new VCLXDevice;
-            pUnoRefDevice->SetOutputDevice( m_pEngine->GetRefDevice() );
+            {
+                SolarMutexGuard g;
+                pUnoRefDevice->SetOutputDevice( m_pEngine->GetRefDevice() );
+            }
             m_xReferenceDevice = pUnoRefDevice;
         }
 
diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx
index 6d335d9..e7c8624 100644
--- a/forms/source/solar/component/navbarcontrol.cxx
+++ b/forms/source/solar/component/navbarcontrol.cxx
@@ -435,10 +435,13 @@ namespace frm
 
     void ONavigationBarPeer::allFeatureStatesChanged( )
     {
-        // force the control to update it's states
-        VclPtr< NavigationToolBar > pNavBar = GetAs< NavigationToolBar >();
-        if ( pNavBar )
-            pNavBar->setDispatcher( this );
+        {
+            // force the control to update it's states
+            SolarMutexGuard g;
+            VclPtr< NavigationToolBar > pNavBar = GetAs< NavigationToolBar >();
+            if ( pNavBar )
+                pNavBar->setDispatcher( this );
+        }
 
         // base class
         OFormNavigationHelper::allFeatureStatesChanged( );
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index 47c9cf1..2e0cdb1 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -80,6 +80,7 @@ CloseDispatcher::~CloseDispatcher()
 {
     SolarMutexGuard g;
     m_aAsyncCallback.reset();
+    m_pSysWindow.reset();
 }
 
 void SAL_CALL CloseDispatcher::dispatch(const css::util::URL&                                  aURL      ,
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 4af01f7..7155673 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -2115,6 +2115,7 @@ throw (RuntimeException, std::exception)
             Reference< awt::XWindow > xWindow( m_aStatusBarElement.m_xUIElement->getRealInterface(), UNO_QUERY );
             if ( xWindow.is() )
             {
+                SolarMutexGuard g;
                 vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
                 if ( pWindow && pWindow->IsVisible() )
                     return sal_True;
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 6c080b8..d2a27b6 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -93,6 +93,9 @@ AccessibleDocumentViewBase::~AccessibleDocumentViewBase()
 {
     // At this place we should be disposed.  You may want to add a
     // corresponding assertion into the destructor of a derived class.
+
+    SolarMutexGuard g;
+    mpWindow.reset();
 }
 
 void AccessibleDocumentViewBase::Init()
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 05713df..1223e18 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -2320,6 +2320,7 @@ void SAL_CALL SVTXDateField::setProperty( const OUString& PropertyName, const ::
     VCLXDateField::setProperty( PropertyName, Value );
 
     // some properties need to be forwarded to the sub edit, too
+    SolarMutexGuard g;
     VclPtr< Edit > pSubEdit = GetWindow() ? static_cast< Edit* >( GetWindow().get() )->GetSubEdit() : NULL;
     if ( !pSubEdit )
         return;
diff --git a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
index 416dfa6..b141ce8 100644
--- a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
+++ b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
@@ -19,6 +19,7 @@
 
 
 #include <svx/AccessibleShapeTreeInfo.hxx>
+#include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
 
 using namespace ::com::sun::star;
@@ -71,7 +72,8 @@ AccessibleShapeTreeInfo& AccessibleShapeTreeInfo::operator= (const AccessibleSha
 
 AccessibleShapeTreeInfo::~AccessibleShapeTreeInfo()
 {
-    //empty
+    SolarMutexGuard g;
+    mpWindow.reset();
 }
 
 
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index db32ea8..f69d1da 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -2633,10 +2633,10 @@ void FmXGridPeer::resetted(const EventObject& rEvent) throw( RuntimeException, s
 {
     if (m_xColumns == rEvent.Source)
     {   // my model was reset -> refresh the grid content
+        SolarMutexGuard aGuard;
         VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
         if (!pGrid)
             return;
-        SolarMutexGuard aGuard;
         pGrid->resetCurrentRow();
     }
     // if the cursor fired a reset event we seem to be on the insert row
diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx
index da7ad04..aff2261 100644
--- a/toolkit/source/awt/vclxdevice.cxx
+++ b/toolkit/source/awt/vclxdevice.cxx
@@ -50,6 +50,9 @@ VCLXDevice::VCLXDevice()
 
 VCLXDevice::~VCLXDevice()
 {
+    //TODO: why was this empty, and everything done in ~VCLXVirtualDevice?
+    SolarMutexGuard g;
+    mpOutputDevice.reset();
 }
 
 void VCLXDevice::SetCreatedWithToolkit( bool bCreatedWithToolkit )
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index 073afa5..482e29c 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -80,6 +80,9 @@ VCLXGraphics::~VCLXGraphics()
     }
 
     delete mpClipRegion;
+
+    SolarMutexGuard g;
+    mpOutputDevice.reset();
 }
 
 void VCLXGraphics::SetOutputDevice( OutputDevice* pOutDev )
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index b5ddd77..cf14157 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1463,6 +1463,8 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
 
 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL VCLXToolkit::getDragGestureRecognizer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException, std::exception)
 {
+    SolarMutexGuard g;
+
     vcl::Window * pWindow = VCLUnoHelper::GetWindow( window );
 
     if( pWindow )
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 9c85e62..0952e97 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -640,8 +640,12 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent
         // Since the implementations for the listeners changed a lot towards 1.1, this
         // would not be the case anymore, if we would not do this listener-lock below
         // #i14703#
-        vcl::Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() );
-        VCLXWindow* pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : NULL;
+        VCLXWindow* pPeer;
+        {
+            SolarMutexGuard g;
+            vcl::Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() );
+            pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : NULL;
+        }
         VclListenerLock aNoVclEventMultiplexing( pPeer );
 
         // setting peer properties may result in an attempt to acquire the solar mutex, 'cause the peers


More information about the Libreoffice-commits mailing list