diff options
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/prj/build.lst | 2 | ||||
-rw-r--r-- | cppuhelper/source/factory.cxx | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/cppuhelper/prj/build.lst b/cppuhelper/prj/build.lst index de66b2d61a4b6..ff837f90dd1aa 100644 --- a/cppuhelper/prj/build.lst +++ b/cppuhelper/prj/build.lst @@ -1,4 +1,4 @@ -ch cppuhelper : BOOST:boost codemaker cppu offuh NULL +ch cppuhelper : BOOST:boost LIBXSLT:libxslt codemaker cppu offuh NULL ch cppuhelper usr1 - all ch_mkout NULL ch cppuhelper\inc nmake - all ch_include NULL ch cppuhelper\source nmake - all ch_source ch_unotypes ch_include NULL diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 96faf22722319..20adf05391b92 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; |