diff options
author | Luke Dixon <luke@luke.dixon.name> | 2020-08-30 13:35:20 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-02 20:55:25 +0200 |
commit | c13671108fa7cee0cc1801e4c08800de1daab850 (patch) | |
tree | 0899d326d204ecefec3b19d8805f05f364f1c18b /starmath | |
parent | 6c8e9d47f9a8e09349dc1dbd3155461cc96034ff (diff) |
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@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/cursor.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |