summaryrefslogtreecommitdiff
path: root/filter/source/flash
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-04-10 17:14:06 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-04-11 09:55:01 +0900
commit896cacf059005e254f7d502a353f4cca74f9832e (patch)
tree8314ffbc29100c2c9882cbf16ed2bb87f2fb454a /filter/source/flash
parentb15666fd7582729c75bd0dd1bd0cb5d7c5a77f0c (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: I43cce6b6c41582a65ff7e59de9a107b30cf8b1e8
Diffstat (limited to 'filter/source/flash')
-rw-r--r--filter/source/flash/swfexporter.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx
index 26c8197d891c..9f24474ee246 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -36,6 +36,7 @@
#include <vcl/wmf.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/gdimetafiletools.hxx>
+#include <boost/scoped_ptr.hpp>
#include "swfexporter.hxx"
#include "swfwriter.hxx"
@@ -601,7 +602,7 @@ void FlashExporter::exportShape( const Reference< XShape >& xShape, bool bMaster
com::sun::star::awt::Rectangle aBoundRect;
xPropSet->getPropertyValue( "BoundRect" ) >>= aBoundRect;
- ShapeInfo* pShapeInfo = new ShapeInfo();
+ boost::scoped_ptr<ShapeInfo> pShapeInfo(new ShapeInfo());
pShapeInfo->mnX = aBoundRect.X;
pShapeInfo->mnY = aBoundRect.Y;
pShapeInfo->mnWidth = aBoundRect.Width;
@@ -651,18 +652,13 @@ void FlashExporter::exportShape( const Reference< XShape >& xShape, bool bMaster
}
if (!nID)
- {
- delete pShapeInfo;
return;
- }
pShapeInfo->mnID = nID;
// pPageInfo->addShape( pShapeInfo );
mpWriter->placeShape( pShapeInfo->mnID, _uInt16(nPlaceDepth++), pShapeInfo->mnX, pShapeInfo->mnY );
-
- delete pShapeInfo;
}
catch( const Exception& )
{