summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2010-12-17 15:11:37 +0100
committerHans-Joachim Lankenau <hjs@openoffice.org>2010-12-17 15:11:37 +0100
commitd3c308b56f895fde86164de9cd8591f999597c59 (patch)
tree58121d0e6b4e4b5c9a6dae054cd838f4e2ad11e7 /cppuhelper
parentf9b5a6bdc3296cbb41982a51f510c590349d83ad (diff)
parent62efb3b2bc02adc3787900c649c34be93c8a65c2 (diff)
CWS-TOOLING: integrate CWS chart49
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;