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

Julien Nabet serval2412 at yahoo.fr
Sat Oct 7 11:13:01 UTC 2017


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

New commits:
commit 053b7367ea41ae036c094c56cb61e74eba6056e4
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Oct 7 09:41:11 2017 +0200

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

diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 1a8f93119d5d..767a678e20f8 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -768,9 +768,10 @@ IMPL_LINK(SmElementsDockingWindow, SelectClickHandler, SmElement&, rElement, voi
 
     if (pViewSh)
     {
+        std::unique_ptr<SfxStringItem> pInsertCommand = o3tl::make_unique<SfxStringItem>(SID_INSERTCOMMANDTEXT, rElement.getText());
         pViewSh->GetViewFrame()->GetDispatcher()->ExecuteList(
             SID_INSERTCOMMANDTEXT, SfxCallMode::RECORD,
-            { new SfxStringItem(SID_INSERTCOMMANDTEXT, rElement.getText()) });
+            { pInsertCommand.get() });
     }
 }
 


More information about the Libreoffice-commits mailing list