summaryrefslogtreecommitdiff
path: root/starmath/source/cursor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source/cursor.cxx')
-rw-r--r--starmath/source/cursor.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 01c4b375fafa..954563ec88d0 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -114,14 +114,14 @@ void SmCursor::BuildGraph(){
_anchor = mpAnchor->CaretPos;
if(mpPosition)
_position = mpPosition->CaretPos;
- delete mpGraph;
+ mpGraph.reset();
//Reset anchor and position as they point into an old graph
mpAnchor = nullptr;
mpPosition = nullptr;
}
//Build the new graph
- mpGraph = SmCaretPosGraphBuildingVisitor(mpTree).takeGraph();
+ mpGraph.reset(SmCaretPosGraphBuildingVisitor(mpTree).takeGraph());
//Restore anchor and position pointers
if(_anchor.IsValid() || _position.IsValid()){