summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-10-26 06:39:42 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-26 08:53:41 +0200
commit4130a5c4b07b5d440d05ab7df0d593373cd76044 (patch)
tree665e15f9284f1d39393a733602ca1ef7ecc38f79 /svtools
parentb4e235a925b5c73a2220f57cdb8b85379fb3bac1 (diff)
Fix memory leak
Change-Id: I2638a8440601264ff00221ead28a71c891abae16 Reviewed-on: https://gerrit.libreoffice.org/43860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/exportdialog.cxx7
-rw-r--r--svtools/source/filter/exportdialog.hxx3
2 files changed, 5 insertions, 5 deletions
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index c1d6138a6ea4..7f6d7652de77 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -400,8 +400,7 @@ void ExportDialog::GetGraphicStream()
{
if ( !IsTempExportAvailable() )
{
- delete mpTempStream;
- mpTempStream = new SvMemoryStream();
+ mpTempStream.reset(new SvMemoryStream());
maBitmap = Bitmap();
return;
}
@@ -419,8 +418,7 @@ void ExportDialog::GetGraphicStream()
{
if ( bRecreateOutputStream )
{
- delete mpTempStream;
- mpTempStream = new SvMemoryStream();
+ mpTempStream.reset(new SvMemoryStream());
maBitmap = Bitmap();
uno::Reference< graphic::XGraphic > xGraphic;
@@ -1012,6 +1010,7 @@ ExportDialog::~ExportDialog()
void ExportDialog::dispose()
{
+ mpTempStream.reset();
delete mpFilterOptionsItem;
delete mpOptionsItem;
mpMfSizeX.clear();
diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx
index 5c50660cb2e5..b8bf28321f1e 100644
--- a/svtools/source/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <memory>
/*************************************************************************
|*
@@ -118,7 +119,7 @@ private:
sal_Int16 mnFormat;
sal_Int32 mnMaxFilesizeForRealtimePreview;
- SvMemoryStream* mpTempStream;
+ std::unique_ptr<SvMemoryStream> mpTempStream;
Bitmap maBitmap;
css::awt::Size maOriginalSize; // the original graphic size in 1/100mm