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

Luke Dixon (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 2 18:56:16 UTC 2020


 starmath/source/cursor.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c13671108fa7cee0cc1801e4c08800de1daab850
Author:     Luke Dixon <luke at luke.dixon.name>
AuthorDate: Sun Aug 30 13:35:20 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 2 20:55:25 2020 +0200

    Fix crash when entering newline in starmath experimental editor
    
    Currently things crash when adding a newline using the experimental
    editor in Math Formula editor. It looks like this is happening because
    the newly inserted line was getting destroyed when the unique_ptr goes
    out of scope.
    
    This change releases the unique_ptr so it doesn't get destroyed. As it
    is now part of the tree it should be destroyed elsewhere.
    
    Change-Id: Icfe2c0289c12302d39883dc04cef0351467aa845
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101737
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 2aae7adb555e..5e69b5876a45 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -765,7 +765,7 @@ bool SmCursor::InsertRow() {
             pTable->SetSubNode(i, pTable->GetSubNode(i-1));
 
         //Insert new line
-        pTable->SetSubNode(nTableIndex + 1, pNewLine.get());
+        pTable->SetSubNode(nTableIndex + 1, pNewLine.release());
 
         //Check if we need to change token type:
         if(pTable->GetNumSubNodes() > 2 && pTable->GetToken().eType == TBINOM) {


More information about the Libreoffice-commits mailing list