[Libreoffice-commits] core.git: chart2/source framework/source include/vcl scripting/Library_protocolhandler.mk sdext/CppunitTest_sdext_pdfimport.mk sdext/Executable_pdf2xml.mk sdext/Executable_pdfunzip.mk sdext/Library_pdfimport.mk

Noel Grandin noel.grandin at collabora.co.uk
Thu Dec 8 17:27:14 UTC 2016


 chart2/source/model/main/ChartModel.cxx                 |    2 ++
 framework/source/dispatch/closedispatcher.cxx           |    1 +
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |    1 +
 framework/source/loadenv/loadenv.cxx                    |    1 +
 framework/source/services/frame.cxx                     |    3 +++
 framework/source/uielement/menubarmanager.cxx           |    3 +++
 include/vcl/vclreferencebase.hxx                        |    3 +++
 scripting/Library_protocolhandler.mk                    |    1 +
 sdext/CppunitTest_sdext_pdfimport.mk                    |    1 +
 sdext/Executable_pdf2xml.mk                             |    1 +
 sdext/Executable_pdfunzip.mk                            |    1 +
 sdext/Library_pdfimport.mk                              |    1 +
 12 files changed, 19 insertions(+)

New commits:
commit e794ce1eef6730e5a46d5fb0aa6db2895ede85e7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Dec 8 13:55:54 2016 +0200

    verify that we hold the SolarMutex when ref-counting VclPtr
    
    Change-Id: If0c5a8c99f0f853c9ecad0f1a4a7299d69805b34
    Reviewed-on: https://gerrit.libreoffice.org/31755
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 6d3b817..b9f59a9 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -35,6 +35,7 @@
 #include <svx/charthelper.hxx>
 
 #include <vcl/openglwin.hxx>
+#include <vcl/svapp.hxx>
 
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
 
@@ -1425,6 +1426,7 @@ void ChartModel::setWindow( const sal_uInt64 nWindowPtr )
     throw (uno::RuntimeException, std::exception)
 {
     OpenGLWindow* pWindow = reinterpret_cast<OpenGLWindow*>(nWindowPtr);
+    SolarMutexGuard aGuard;
     mpOpenGLWindow = pWindow;
 }
 
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index afab7e8..6d5b03b 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -71,6 +71,7 @@ CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponent
     uno::Reference<awt::XWindow> xWindow = xTarget->getContainerWindow();
     if (xWindow.is())
     {
+        SolarMutexGuard g;
         VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindow);
         if (pWindow->IsSystemWindow())
             m_pSysWindow = dynamic_cast<SystemWindow*>(pWindow.get());
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index eefd7dc..4db5ca5 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -2554,6 +2554,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn(
             nCurrPos += ( aWinRect.Y - nCurrPos ) + aWinRect.Height;
         }
     }
+    pDockAreaWindow.clear(); // must be cleared under SolarMutex
 }
 
 void ToolbarLayoutManager::implts_setLayoutDirty()
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 8e12882..012a7ba6 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1672,6 +1672,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
     WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow.get());
     if (pWorkWindow->IsMinimized())
         return;
+    pWindow.clear(); // must be cleared under SolarMutex
 
     aSolarGuard1.clear();
     // <- SOLAR SAFE
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 09e5104..da5a346 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -876,6 +876,8 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
     VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindow);
     if (pWindow && pWindow->IsVisible())
         m_bIsHidden = false;
+    // must be cleared while under the SolarMutex
+    pWindow.clear();
 
     css::uno::Reference< css::frame::XLayoutManager2 >  xLayoutManager = m_xLayoutManager;
 
@@ -1542,6 +1544,7 @@ sal_Bool SAL_CALL Frame::setComponent(const css::uno::Reference< css::awt::XWind
     css::uno::Reference< css::frame::XController > xOldController = m_xController;
     VclPtr<vcl::Window> pOwnWindow = VCLUnoHelper::GetWindow( xContainerWindow );
     bool bHadFocus = pOwnWindow->HasChildPathFocus();
+    pOwnWindow.clear(); // must be cleared under SolarMutex
     bool bWasConnected = m_bConnected;
     aReadLock.clear();
     /* } SAFE */
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 530df3e..066e2456 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -222,6 +222,9 @@ MenuBarManager::~MenuBarManager()
     m_aAsyncSettingsTimer.Stop();
 
     SAL_WARN_IF( OWeakObject::m_refCount != 0, "fwk.uielement", "Who wants to delete an object with refcount > 0!" );
+
+    SolarMutexGuard aGuard;
+    m_pVCLMenu.clear();
 }
 
 void MenuBarManager::Destroy()
diff --git a/include/vcl/vclreferencebase.hxx b/include/vcl/vclreferencebase.hxx
index 7713d93..dbd3bc9 100644
--- a/include/vcl/vclreferencebase.hxx
+++ b/include/vcl/vclreferencebase.hxx
@@ -21,6 +21,7 @@
 
 #include <vcl/dllapi.h>
 #include <vcl/vclptr.hxx>
+#include <tools/debug.hxx>
 #include <cassert>
 
 class VclReferenceBase;
@@ -35,12 +36,14 @@ class VCL_DLLPUBLIC VclReferenceBase
 public:
     inline void acquire() const
     {
+        DBG_TESTSOLARMUTEX();
         assert(mnRefCnt>0);
         mnRefCnt++;
     }
 
     inline void release() const
     {
+        DBG_TESTSOLARMUTEX();
         assert(mnRefCnt>0);
         if (!--mnRefCnt)
             delete this;
diff --git a/scripting/Library_protocolhandler.mk b/scripting/Library_protocolhandler.mk
index 4134c2a..15cf1e0 100644
--- a/scripting/Library_protocolhandler.mk
+++ b/scripting/Library_protocolhandler.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_Library_use_libraries,protocolhandler,\
 	fwe \
 	sal \
 	sfx \
+	tl \
 	vcl \
 	$(gb_UWINAPI) \
 ))
diff --git a/sdext/CppunitTest_sdext_pdfimport.mk b/sdext/CppunitTest_sdext_pdfimport.mk
index 2642786..0676aaf 100644
--- a/sdext/CppunitTest_sdext_pdfimport.mk
+++ b/sdext/CppunitTest_sdext_pdfimport.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sdext_pdfimport,\
     cppuhelper \
     sal \
     test \
+    tl \
     unotest \
 	$(gb_UWINAPI) \
 ))
diff --git a/sdext/Executable_pdf2xml.mk b/sdext/Executable_pdf2xml.mk
index 373f40d..add8262 100644
--- a/sdext/Executable_pdf2xml.mk
+++ b/sdext/Executable_pdf2xml.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Executable_use_libraries,pdf2xml,\
     unotest \
     cppuhelper \
     sal \
+    tl \
 ))
 
 $(eval $(call gb_Executable_use_library_objects,pdf2xml,pdfimport))
diff --git a/sdext/Executable_pdfunzip.mk b/sdext/Executable_pdfunzip.mk
index 74b1a96..0004adf 100644
--- a/sdext/Executable_pdfunzip.mk
+++ b/sdext/Executable_pdfunzip.mk
@@ -28,6 +28,7 @@ $(eval $(call gb_Executable_use_libraries,pdfunzip,\
     cppuhelper \
     sal \
     vcl \
+    tl \
 ))
 
 $(eval $(call gb_Executable_use_library_objects,pdfunzip,pdfimport))
diff --git a/sdext/Library_pdfimport.mk b/sdext/Library_pdfimport.mk
index d181ae1..411c047 100644
--- a/sdext/Library_pdfimport.mk
+++ b/sdext/Library_pdfimport.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_Library_use_libraries,pdfimport,\
     cppu \
     cppuhelper \
     sal \
+    tl \
 ))
 
 $(eval $(call gb_Library_use_externals,pdfimport,\


More information about the Libreoffice-commits mailing list