summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 08:56:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 12:46:56 +0100
commit06ad764cfb36ece7f054ecb786cc0395346a6a68 (patch)
treef67c2045e736fbbdb67d18255380b2d9288d75e4 /stoc
parenta73494cf130866d4e678a1f421df56cdba7441d8 (diff)
improve function-local statics in scripting..svtools
Change-Id: Idf3785a1fbc6fc5b8efbdc4cd363047709f3af91 Reviewed-on: https://gerrit.libreoffice.org/63782 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/javaloader/javaloader.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 34d80b4f3b52..19dc5d875049 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -346,16 +346,8 @@ static css::uno::Reference<XInterface> JavaComponentLoader_CreateInstance(const
MutexGuard guard( getInitMutex() );
// The javaloader is never destroyed and there can be only one!
// Note that the first context wins ....
- static css::uno::Reference< XInterface > xStaticRef;
- if( xStaticRef.is() )
- {
- xRet = xStaticRef;
- }
- else
- {
- xRet = *new JavaComponentLoader(xCtx);
- xStaticRef = xRet;
- }
+ static css::uno::Reference< XInterface > xStaticRef = *new JavaComponentLoader(xCtx);
+ xRet = xStaticRef;
}
catch(const RuntimeException & runtimeException) {
SAL_INFO(