summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-08 09:07:44 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-11 05:28:46 +0000
commit54f83fee8451928b7078c0f9c96ec4187309bc00 (patch)
tree19d7017ae57e519fb6a2c0a9f38873d83d5d1e8f /embeddedobj
parent60362e62ad5c9982ac7a0afec74f714cf0d9efa7 (diff)
tdf#56818, use SolarMutex instead of own Mutex
There is a SolarMutexReleaser in the call chain so that using an own mutex can deadlock. Change-Id: I1dd0b0c78ce6cf436a470319e616099cb947b6e0 Reviewed-on: https://gerrit.libreoffice.org/27085 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index bba9f2684771..00464a7a6cae 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -32,6 +32,8 @@
#include <comphelper/mimeconfighelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <vcl/svapp.hxx>
+
#include "closepreventer.hxx"
#include "intercept.hxx"
#include "persistence.hxx"
@@ -435,7 +437,7 @@ void SAL_CALL OCommonEmbeddedObject::setClassInfo(
uno::Reference< util::XCloseable > SAL_CALL OCommonEmbeddedObject::getComponent()
throw ( uno::RuntimeException, std::exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
@@ -454,7 +456,7 @@ uno::Reference< util::XCloseable > SAL_CALL OCommonEmbeddedObject::getComponent(
void SAL_CALL OCommonEmbeddedObject::addStateChangeListener( const uno::Reference< embed::XStateChangeListener >& xListener )
throw ( uno::RuntimeException, std::exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
@@ -470,7 +472,7 @@ void SAL_CALL OCommonEmbeddedObject::removeStateChangeListener(
const uno::Reference< embed::XStateChangeListener >& xListener )
throw (uno::RuntimeException, std::exception)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_pInterfaceContainer )
m_pInterfaceContainer->removeInterface( cppu::UnoType<embed::XStateChangeListener>::get(),
xListener );
@@ -481,7 +483,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
throw ( util::CloseVetoException,
uno::RuntimeException, std::exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_bClosed )
throw lang::DisposedException(); // TODO
@@ -585,12 +587,12 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
void SAL_CALL OCommonEmbeddedObject::addCloseListener( const uno::Reference< util::XCloseListener >& xListener )
throw ( uno::RuntimeException, std::exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
if ( !m_pInterfaceContainer )
- m_pInterfaceContainer = new ::cppu::OMultiTypeInterfaceContainerHelper( m_aMutex );
+ m_pInterfaceContainer = new ::cppu::OMultiTypeInterfaceContainerHelper(m_aMutex);
m_pInterfaceContainer->addInterface( cppu::UnoType<util::XCloseListener>::get(), xListener );
}
@@ -599,7 +601,7 @@ void SAL_CALL OCommonEmbeddedObject::addCloseListener( const uno::Reference< uti
void SAL_CALL OCommonEmbeddedObject::removeCloseListener( const uno::Reference< util::XCloseListener >& xListener )
throw (uno::RuntimeException, std::exception)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_pInterfaceContainer )
m_pInterfaceContainer->removeInterface( cppu::UnoType<util::XCloseListener>::get(),
xListener );
@@ -609,12 +611,12 @@ void SAL_CALL OCommonEmbeddedObject::removeCloseListener( const uno::Reference<
void SAL_CALL OCommonEmbeddedObject::addEventListener( const uno::Reference< document::XEventListener >& xListener )
throw ( uno::RuntimeException, std::exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
if ( !m_pInterfaceContainer )
- m_pInterfaceContainer = new ::cppu::OMultiTypeInterfaceContainerHelper( m_aMutex );
+ m_pInterfaceContainer = new ::cppu::OMultiTypeInterfaceContainerHelper(m_aMutex);
m_pInterfaceContainer->addInterface( cppu::UnoType<document::XEventListener>::get(), xListener );
}
@@ -623,7 +625,7 @@ void SAL_CALL OCommonEmbeddedObject::addEventListener( const uno::Reference< doc
void SAL_CALL OCommonEmbeddedObject::removeEventListener( const uno::Reference< document::XEventListener >& xListener )
throw ( uno::RuntimeException, std::exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ SolarMutexGuard aGuard;
if ( m_pInterfaceContainer )
m_pInterfaceContainer->removeInterface( cppu::UnoType<document::XEventListener>::get(),
xListener );