summaryrefslogtreecommitdiff
path: root/cppuhelper/source/factory.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-18 15:58:02 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-18 15:58:02 +0100
commita3a19632f413a6fe8dee97f02d637e7197869b50 (patch)
treeb8a01b5b560e18bdb007ec5ff2fafd50a3c508a9 /cppuhelper/source/factory.cxx
parent999dce7d69e20561c3f39476e074043838eb7514 (diff)
parent793a9a799346aebbf0a50d8d4f15081d9032d57c (diff)
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts: bridges/source/remote/urp/urp_environment.cxx bridges/source/remote/urp/urp_propertyobject.cxx bridges/source/remote/urp/urp_reader.cxx remotebridges/source/factory/bridgefactory.cxx stoc/source/corereflection/crefl.cxx stoc/source/javavm/javavm.cxx stoc/source/simpleregistry/simpleregistry.cxx
Diffstat (limited to 'cppuhelper/source/factory.cxx')
-rw-r--r--cppuhelper/source/factory.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index af2df37e79e1..3135c3447619 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -229,9 +229,17 @@ Reference< XInterface > OSingleFactoryHelper::createInstanceWithArgumentsAndCont
else
{
if ( rArguments.getLength() )
+ {
+ // dispose the here created UNO object before throwing out exception
+ // to avoid risk of memory leaks #i113722#
+ Reference<XComponent> xComp( xRet, UNO_QUERY );
+ if (xComp.is())
+ xComp->dispose();
+
throw lang::IllegalArgumentException(
OUString( RTL_CONSTASCII_USTRINGPARAM("cannot pass arguments to component => no XInitialization implemented!") ),
Reference< XInterface >(), 0 );
+ }
}
return xRet;