summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-27 12:52:16 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-27 12:48:50 +0000
commite25669fcedcb7231254d3ba0e0224b2e3eb901d8 (patch)
tree05ce242744c88d9efcd5b685720b2178008c2c8c /stoc
parent96d03636a5f932151c7842ae34631258891fe807 (diff)
don't allocate uno::Reference on the heap
There is no point, since it's the size of a pointer anyway (found by temporarily making the new operator in uno::Reference deleted). Change-Id: I62a8b957fef9184f65d705600acfdab4116dcb34 Reviewed-on: https://gerrit.libreoffice.org/19603 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/javaloader/javaloader.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 3a454f16b5cb..7b80dbd492e7 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -372,15 +372,15 @@ css::uno::Reference<XInterface> SAL_CALL JavaComponentLoader_CreateInstance(cons
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 > *pStaticRef = 0;
- if( pStaticRef )
+ static css::uno::Reference< XInterface > xStaticRef;
+ if( xStaticRef.is() )
{
- xRet = *pStaticRef;
+ xRet = xStaticRef;
}
else
{
xRet = *new JavaComponentLoader(xCtx);
- pStaticRef = new css::uno::Reference< XInterface > ( xRet );
+ xStaticRef = xRet;
}
}
catch(const RuntimeException & runtimeException) {