[Libreoffice-commits] core.git: starmath/source

Julien Nabet serval2412 at yahoo.fr
Sat Oct 7 11:05:42 UTC 2017


 starmath/source/edit.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 65a82fd7c04fd029ada6376749f74043bc80e216
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Oct 7 10:12:15 2017 +0200

    Fix leak in smEditWindow (starmath)
    
    Change-Id: I7eb2af795d4b7d3619fe78ae16ea5796e5943f2c
    Reviewed-on: https://gerrit.libreoffice.org/43221
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

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())


More information about the Libreoffice-commits mailing list