[Libreoffice-commits] core.git: 2 commits - chart2/source svl/source
Michael Stahl
mstahl at redhat.com
Fri Nov 28 10:22:50 PST 2014
chart2/source/controller/main/ChartController.cxx | 16 +++++++++---
chart2/source/controller/main/ControllerCommandDispatch.cxx | 9 ++++++
svl/source/items/itemset.cxx | 9 ------
3 files changed, 21 insertions(+), 13 deletions(-)
New commits:
commit 47588a4c98f1b668c7ffe2575c7e0851a63316bb
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Nov 28 19:16:17 2014 +0100
svl: SfxItemSet: get rid of the "no master pool" warning spam
No idea why that would be a problem.
Change-Id: Ib655b71ed8cd8a4fe8200209c929434832f3614e
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index c397312..22105af 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -89,7 +89,6 @@ SfxItemSet::SfxItemSet
_pParent( 0 ),
_nCount( 0 )
{
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// DBG_ASSERT( bTotalRanges || abs( &bTotalRanges - this ) < 1000,
// "please use suitable ranges" );
#if defined DBG_UTIL && defined SFX_ITEMSET_NO_DEFAULT_CTOR
@@ -117,7 +116,6 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhic
_nCount( 0 )
{
assert(nWhich1 <= nWhich2);
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
InitRanges_Impl(nWhich1, nWhich2);
}
@@ -154,7 +152,6 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool,
_nCount( 0 )
{
assert(nWh1 <= nWh2);
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
if(!nNull)
InitRanges_Impl(
@@ -201,8 +198,6 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable )
, _pWhichRanges(0)
, _nCount(0)
{
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
-
// pWhichPairTable == 0 ist f"ur das SfxAllEnumItemSet
if ( pWhichPairTable )
InitRanges_Impl(pWhichPairTable);
@@ -213,8 +208,6 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
_pParent( rASet._pParent ),
_nCount( rASet._nCount )
{
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
-
// Calculate the attribute count
sal_uInt16 nCnt = 0;
sal_uInt16* pPtr = rASet._pWhichRanges;
@@ -1402,7 +1395,6 @@ SvStream &SfxItemSet::Store
) const
{
assert(_pPool);
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// Remember position of the count (to be able to correct it, if need be)
sal_uLong nCountPos = rStream.Tell();
@@ -1467,7 +1459,6 @@ SvStream &SfxItemSet::Load
)
{
assert(_pPool);
- SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// No RefPool => Resolve Surrogates with ItemSet's Pool
if ( !pRefPool )
commit 426ef2847cbdc74c068531915efb852a727cd3ee
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Nov 28 18:39:52 2014 +0100
chart2: ChartController: fix CommandDispatchContainer access locking
crashes on concurrent setModel() and getDispatchForURL() in
JunitTest_chart2_unoapi:
Thread 13:
7 in (anonymous namespace)::Frame::isActionLocked (this=0x2b66c0e4a090) at /home/tinderbox/master/framework/source/services/frame.cxx:2596
8 in (anonymous namespace)::Frame::close (this=0x2b66c0e4a090, bDeliverOwnership=0 '\000') at /home/tinderbox/master/framework/source/services/frame.cxx:1772
9 in chart::ChartController::notifyClosing (this=0x2b668ae41058, rSource=...) at /home/tinderbox/master/chart2/source/controller/main/ChartController.cxx:872
10 in apphelper::CloseableLifeTimeManager::impl_doClose (this=0x2b669a0b1d08) at /home/tinderbox/master/chart2/source/tools/LifeTime.cxx:360
11 in apphelper::CloseableLifeTimeManager::g_close_endTryClose_doClose (this=0x2b669a0b1d08) at /home/tinderbox/master/chart2/source/tools/LifeTime.cxx:311
12 in chart::ChartModel::close (this=0x2b669a0b1c28, bDeliverOwnership=1 '\001') at /home/tinderbox/master/chart2/source/model/main/ChartModel.cxx:659
Thread 1:
4 in std::__debug::map<rtl::OUString, com::sun::star::uno::Reference<com::sun::star::frame::XDispatch>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, com::sun::star::uno::Reference<com::sun::star::frame::XDispatch> > > >::find (this=0x2b668ae41248, __x=...) at /usr/include/c++/4.8.3/debug/map.h:382
No locals.
5 in chart::CommandDispatchContainer::getDispatchForURL (this=0x2b668ae41248, rURL=...) at /home/tinderbox/master/chart2/source/controller/main/CommandDispatchContainer.cxx:80
6 in chart::ChartController::queryDispatch (this=0x2b668ae41058, rURL=..., rTargetFrameName=...) at /home/tinderbox/master/chart2/source/controller/main/ChartController.cxx:1003
No locals.
7 in framework::DispatchProvider::implts_queryFrameDispatch (this=0x2b66a3fd21e8, xFrame=..., aURL=..., sTargetFrameName=..., nSearchFlags=0) at /home/tinderbox/master/framework/source/dispatch/dispatchprovider.cxx:374
8 in framework::DispatchProvider::queryDispatch (this=0x2b66a3fd21e8, aURL=..., sTargetFrameName=..., nSearchFlags=0) at /home/tinderbox/master/framework/source/dispatch/dispatchprovider.cxx:111
9 in framework::InterceptionHelper::queryDispatch (this=0x2b668a61bc08, aURL=..., sTargetFrameName=..., nSearchFlags=0) at /home/tinderbox/master/framework/source/dispatch/interceptionhelper.cxx:78
10 in (anonymous namespace)::Frame::queryDispatch (this=0x2b66c0e4a090, aURL=..., sTargetFrameName=..., nSearchFlags=0) at /home/tinderbox/master/framework/source/services/frame.cxx:2227
11 in svt::ToolboxController::bindListener (this=0x2b66c0f72740) at /home/tinderbox/master/svtools/source/uno/toolboxcontroller.cxx:529
12 in svt::ToolboxController::update (this=0x2b66c0f72740) at /home/tinderbox/master/svtools/source/uno/toolboxcontroller.cxx:232
13 in framework::ToolBarManager::UpdateControllers (this=0x2b669a0a1728) at /home/tinderbox/master/framework/source/uielement/toolbarmanager.cxx:440
14 in framework::ToolBarManager::AsyncUpdateControllersHdl (this=0x2b669a0a1728) at /home/tinderbox/master/framework/source/uielement/toolbarmanager.cxx:2110
15 in framework::ToolBarManager::LinkStubAsyncUpdateControllersHdl (pThis=0x2b669a0a1728, pCaller=0x2b669a0a1890) at /home/tinderbox/master/framework/source/uielement/toolbarmanager.cxx:2097
16 in Link::Call (this=0x2b669a0a18b0, pCaller=0x2b669a0a1890) at /home/tinderbox/master/include/tools/link.hxx:139
17 in Timer::Timeout (this=0x2b669a0a1890) at /home/tinderbox/master/vcl/source/app/timer.cxx:276
Change-Id: I17ef63db8f7c288460e00031e8e8a5c3e4d086b3
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index a9ff0c6..7accfe9 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -491,10 +491,10 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
//is called to attach the controller to a new model.
//return true if attach was successfully, false otherwise (e.g. if you do not work with a model)
- SolarMutexClearableGuard aClearableGuard;
+ SolarMutexResettableGuard aGuard;
if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended?
return sal_False; //behave passive if already disposed or suspended
- aClearableGuard.clear();
+ aGuard.clear();
TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex);
TheModelRef aOldModelRef(m_aModel,m_aModelMutex);
@@ -519,6 +519,7 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
//--handle relations to the new model
aNewModelRef->addListener( this );
+ aGuard.reset(); // lock for m_aDispatchContainer access
// set new model at dispatchers
m_aDispatchContainer.setModel( aNewModelRef->getModel());
ControllerCommandDispatch * pDispatch = new ControllerCommandDispatch( m_xCC, this, &m_aDispatchContainer );
@@ -542,6 +543,7 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
pShapeController->initialize();
m_aDispatchContainer.setShapeController( pShapeController );
}
+ aGuard.clear();
#ifdef TEST_ENABLE_MODIFY_LISTENER
uno::Reference< util::XModifyBroadcaster > xMBroadcaster( aNewModelRef->getModel(),uno::UNO_QUERY );
@@ -565,7 +567,7 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
//the frameloader is responsible to call xModel->connectController
{
- SolarMutexGuard aGuard;
+ SolarMutexGuard aGuard2;
if( m_pChartWindow )
m_pChartWindow->Invalidate();
}
@@ -784,6 +786,7 @@ void SAL_CALL ChartController::dispose()
//// @todo integrate specialized implementation
//e.g. release further resources and references
+ SolarMutexGuard g;
m_aDispatchContainer.DisposeAndClear();
}
catch( const uno::Exception & ex )
@@ -894,7 +897,10 @@ bool ChartController::impl_releaseThisModel(
}
}
if( bReleaseModel )
+ {
+ SolarMutexGuard g;
m_aDispatchContainer.setModel( 0 );
+ }
return bReleaseModel;
}
@@ -997,6 +1003,8 @@ uno::Reference<frame::XDispatch> SAL_CALL
sal_Int32 /* nSearchFlags */)
throw(uno::RuntimeException, std::exception)
{
+ SolarMutexGuard aGuard;
+
if ( !m_aLifeTimeManager.impl_isDisposed() && getModel().is() )
{
if( !rTargetFrameName.isEmpty() && rTargetFrameName == "_self" )
@@ -1010,6 +1018,8 @@ uno::Sequence<uno::Reference<frame::XDispatch > >
const uno::Sequence<frame::DispatchDescriptor>& xDescripts )
throw(uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
if ( !m_aLifeTimeManager.impl_isDisposed() )
{
return m_aDispatchContainer.getDispatchesForURLs( xDescripts );
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 7f4f4c1..e28fbe8 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -32,6 +32,8 @@
#include "StatisticsHelper.hxx"
#include "ShapeController.hxx"
+#include <vcl/svapp.hxx>
+
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -698,7 +700,12 @@ bool ControllerCommandDispatch::commandAvailable( const OUString & rCommand )
bool ControllerCommandDispatch::isShapeControllerCommandAvailable( const OUString& rCommand )
{
- ShapeController* pShapeController = ( m_pDispatchContainer ? m_pDispatchContainer->getShapeController() : NULL );
+ ShapeController* pShapeController(0);
+ {
+ SolarMutexGuard g;
+ if (m_pDispatchContainer)
+ pShapeController = m_pDispatchContainer->getShapeController();
+ }
if ( pShapeController )
{
FeatureState aState( pShapeController->getState( rCommand ) );
More information about the Libreoffice-commits
mailing list