diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-16 09:02:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-16 09:52:32 +0000 |
commit | 02d609ca991b044e584b24054d43ecf70668444e (patch) | |
tree | 1a457b8fcc0b62261ebb518d50228c61c5c59974 /basic | |
parent | 3546a4917a77455b81052e2212fd5eebeeb37011 (diff) |
valgrind: fix leak
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/uno/namecont.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 3d5d71509762..88d3b6b00f5d 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -69,6 +69,7 @@ #include <comphelper/anytostring.hxx> #include <cppuhelper/exc_hlp.hxx> #include <basic/sbmod.hxx> +#include <boost/scoped_ptr.hpp> namespace basic { @@ -1760,7 +1761,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto if( !nLibsToSave ) return; - ::xmlscript::LibDescriptorArray* pLibArray = new ::xmlscript::LibDescriptorArray( nLibsToSave ); + boost::scoped_ptr< ::xmlscript::LibDescriptorArray > pLibArray(new ::xmlscript::LibDescriptorArray(nLibsToSave)); // Write to storage? sal_Bool bStorage = i_rStorage.is(); @@ -2066,7 +2067,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto try { - xmlscript::exportLibraryContainer( xHandler, pLibArray ); + xmlscript::exportLibraryContainer( xHandler, pLibArray.get() ); if ( bStorage ) { uno::Reference< embed::XTransactedObject > xTransact( xTargetLibrariesStor, uno::UNO_QUERY ); @@ -2083,8 +2084,6 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto ULONG nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } - - delete pLibArray; } |