summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2011-01-03 13:09:08 +0100
committersb <sb@openoffice.org>2011-01-03 13:09:08 +0100
commit1b327acf918b99289b8533863df51d64c159e25c (patch)
tree68063806c76abdbf36236b214ceacb59b49bceee /cppuhelper
parent5a9b9d77de92117e13208d0c15bbfc120697e0b7 (diff)
parent77ffc6a41ba05725442df132131597fca78a84ea (diff)
sb135: merged in DEV300_m96
Diffstat (limited to 'cppuhelper')
-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 96faf2272231..20adf05391b9 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -232,9 +232,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;