summaryrefslogtreecommitdiff
path: root/svx/source/unogallery
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-07-04 00:55:08 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-07-04 10:49:10 +0900
commitf38bf4c6c29d685ec4f1015be09f64c7ae2eb172 (patch)
tree84894e4957abbda40a4fa2cc20b200aff3502200 /svx/source/unogallery
parentc061cb94c07dff1d1eac126307e17295460b805b (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: I04a0a2c296206f155ee4916b15b853a7f10c2c2a
Diffstat (limited to 'svx/source/unogallery')
-rw-r--r--svx/source/unogallery/unogalitem.cxx5
1 files changed, 2 insertions, 3 deletions
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 <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/gallery/GalleryItemType.hpp>
+#include <boost/scoped_ptr.hpp>
#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<SgaObject> 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;
}
}
}