diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-05-25 16:22:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-05-25 16:29:31 +0200 |
commit | 3f250092747263fb14a3f13c4509ebd02ec2fb2a (patch) | |
tree | d8eb78431d619909b44206583eae6cf9f02a556d /stoc/source | |
parent | 90f3840e4c767154266c6be1c532f5e748e8c3f7 (diff) |
Use simple createOneInstanceComponentFactory
...instead of static WeakReference and getGlobalMutex. The latter allowed for
deadlock, when one thread is in __getTypeEntries
(cppuhelper/source/implbase_ex.cxx), having locked getImplHelperInitMutex(), and
from there calls some cppu_detail_getUnoType (from a cppumaker-generated header)
that tries to lock getGloblaMutex, while another thread is in this
FactoryImpl_create, having locked getGlobalMutex, and from there calls into
__getTypeEntries.
Change-Id: Iac68d28c1a5971049447cc79384b6e186f2a6d82
Diffstat (limited to 'stoc/source')
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index 337bdb1023c9..361e798cf48f 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -943,19 +943,7 @@ static Reference< XInterface > SAL_CALL FactoryImpl_create( const Reference< XComponentContext > & xContext ) throw (Exception) { - Reference< XInterface > rRet; - { - MutexGuard guard( Mutex::getGlobalMutex() ); - static WeakReference < XInterface > rwInstance; - rRet = rwInstance; - - if( ! rRet.is() ) - { - rRet = (::cppu::OWeakObject *)new FactoryImpl( xContext ); - rwInstance = rRet; - } - } - return rRet; + return (::cppu::OWeakObject *)new FactoryImpl( xContext ); } } @@ -971,7 +959,7 @@ static struct ::cppu::ImplementationEntry g_entries[] = ::stoc_invadp::FactoryImpl_create, ::stoc_invadp::invadp_getImplementationName, ::stoc_invadp::invadp_getSupportedServiceNames, - ::cppu::createSingleComponentFactory, + ::cppu::createOneInstanceComponentFactory, &::stoc_invadp::g_moduleCount.modCnt , 0 }, { 0, 0, 0, 0, 0, 0 } |