summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-28 20:54:50 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-28 22:50:46 -0400
commitdb65eec391287c6c9c4100b2ed47b64ee0fd898f (patch)
treeb3fba0f5a28e61faa27e0afb223287fd9203f642
parentAvoid handling basic manager etc when the embedded scripts are disabled. (diff)
downloadcore-db65eec391287c6c9c4100b2ed47b64ee0fd898f.tar.gz
core-db65eec391287c6c9c4100b2ed47b64ee0fd898f.zip
Avoid static local of a singleton. This crashed writer unit tests.
Change-Id: I7c5f2d372676cdb317a8dad636bf1aab7dd5db37
-rw-r--r--basic/source/classes/sb.cxx4
-rw-r--r--basic/source/classes/sbunoobj.cxx26
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 45e96a24b8dd..086445a25b3e 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -2427,19 +2427,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
{