diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-28 20:54:50 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-29 22:00:38 -0400 |
commit | ad9e67a7c08f9ceb3b4c228e3d9241c4ed54a7c8 (patch) | |
tree | faa6bcee5f21441289c4e343d11cd1643f74fc72 /basic | |
parent | bec6837986137705ba8df950d78f8bc27c44f4af (diff) |
Avoid static local of a singleton. This crashed writer unit tests.
Change-Id: I7c5f2d372676cdb317a8dad636bf1aab7dd5db37
(cherry picked from commit 5a827671d16ff5e927fc3dd4a01e6c32ea05d891)
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sb.cxx | 4 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 26 |
2 files changed, 22 insertions, 8 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 5a37bbcf0291..3d3842840b32 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -128,7 +128,9 @@ void DocBasicItem::stopListening() if( mbDisposed ) return; mbDisposed = true; Any aThisComp; - mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp ); + if (!mrDocBasic.GetUNOConstant("ThisComponent", aThisComp)) + return; + Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY ); if( xCloseBC.is() ) { diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 85343b2dc4ae..56d1024fb6ee 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -2445,19 +2445,31 @@ SbUnoObject::~SbUnoObject() // pass the introspection on Demand void SbUnoObject::doIntrospection( void ) { - static Reference< XIntrospection > xIntrospection; - if( !bNeedIntrospection ) return; - bNeedIntrospection = false; - if( !xIntrospection.is() ) + Reference<XComponentContext> xContext = comphelper::getProcessComponentContext(); + + if (!xContext.is()) + return; + + + // get the introspection service + Reference<XIntrospection> xIntrospection; + + try + { + xIntrospection = theIntrospection::get(xContext); + } + catch ( const css::uno::DeploymentException& ex ) { - // get the introspection service - Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); - xIntrospection = theIntrospection::get( xContext ); } + if (!xIntrospection.is()) + return; + + bNeedIntrospection = false; + // pass the introspection try { |