From f38bf4c6c29d685ec4f1015be09f64c7ae2eb172 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 4 Jul 2014 00:55:08 +0900 Subject: Avoid possible memory leaks in case of exceptions Change-Id: I04a0a2c296206f155ee4916b15b853a7f10c2c2a --- svx/source/unogallery/unogalitem.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'svx/source/unogallery') diff --git a/svx/source/unogallery/unogalitem.cxx b/svx/source/unogallery/unogalitem.cxx index f469953d5a32..adda2244cf57 100644 --- a/svx/source/unogallery/unogalitem.cxx +++ b/svx/source/unogallery/unogalitem.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #define UNOGALLERY_GALLERYITEMTYPE 1 #define UNOGALLERY_URL 2 @@ -271,7 +272,7 @@ void GalleryItem::_setPropertyValues( const comphelper::PropertyMapEntry** ppEnt if( pGalTheme ) { - SgaObject* pObj = pGalTheme->ImplReadSgaObject( const_cast< GalleryObject* >( implGetObject() ) ); + boost::scoped_ptr pObj(pGalTheme->ImplReadSgaObject( const_cast< GalleryObject* >( implGetObject() ) )); if( pObj ) { @@ -280,8 +281,6 @@ void GalleryItem::_setPropertyValues( const comphelper::PropertyMapEntry** ppEnt pObj->SetTitle( aNewTitle ); pGalTheme->InsertObject( *pObj ); } - - delete pObj; } } } -- cgit