summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-10-07 10:12:15 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-10-07 13:05:15 +0200
commit65a82fd7c04fd029ada6376749f74043bc80e216 (patch)
tree7dbbce986c2c0e60ff0a47e76a0cec313f9e7427 /starmath
parent4d31f2e1601efffdbdb3c54227e44666418da5d5 (diff)
Fix leak in smEditWindow (starmath)
Change-Id: I7eb2af795d4b7d3619fe78ae16ea5796e5943f2c Reviewed-on: https://gerrit.libreoffice.org/43221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/edit.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index bf0544aec870..61721a2ee91a 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -28,6 +28,7 @@
#include <editeng/editview.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editstat.hxx>
+#include <o3tl/make_unique.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/stritem.hxx>
#include <sfx2/viewfrm.hxx>
@@ -961,9 +962,10 @@ void SmEditWindow::Flush()
SmViewShell *pViewSh = rCmdBox.GetView();
if (pViewSh)
{
+ std::unique_ptr<SfxStringItem> pTextToFlush = o3tl::make_unique<SfxStringItem>(SID_TEXT, GetText());
pViewSh->GetViewFrame()->GetDispatcher()->ExecuteList(
SID_TEXT, SfxCallMode::RECORD,
- { new SfxStringItem(SID_TEXT, GetText()) });
+ { pTextToFlush.get() });
}
}
if (aCursorMoveIdle.IsActive())