diff options
author | sb <sb@openoffice.org> | 2011-01-03 13:09:08 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2011-01-03 13:09:08 +0100 |
commit | 1b327acf918b99289b8533863df51d64c159e25c (patch) | |
tree | 68063806c76abdbf36236b214ceacb59b49bceee /cppuhelper | |
parent | 5a9b9d77de92117e13208d0c15bbfc120697e0b7 (diff) | |
parent | 77ffc6a41ba05725442df132131597fca78a84ea (diff) |
sb135: merged in DEV300_m96
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/factory.cxx | 8 |
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; |