diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 15:11:37 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 15:11:37 +0100 |
commit | d3c308b56f895fde86164de9cd8591f999597c59 (patch) | |
tree | 58121d0e6b4e4b5c9a6dae054cd838f4e2ad11e7 /cppuhelper | |
parent | f9b5a6bdc3296cbb41982a51f510c590349d83ad (diff) | |
parent | 62efb3b2bc02adc3787900c649c34be93c8a65c2 (diff) |
CWS-TOOLING: integrate CWS chart49
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; |