src/editHistory.cc

changeset 784
f82ab4d3c7b4
parent 768
29e6c5552388
child 838
8f58e1249687
--- a/src/editHistory.cc	Sun Jun 01 03:15:36 2014 +0300
+++ b/src/editHistory.cc	Mon Jun 02 12:50:40 2014 +0300
@@ -130,7 +130,7 @@
 //
 void AddHistory::undo() const
 {
-	LDObjectPtr obj = parent()->document()->getObject (index());
+	LDObjectPtr obj = parent()->document().toStrongRef()->getObject (index());
 	obj->destroy();
 }
 
@@ -139,7 +139,7 @@
 void AddHistory::redo() const
 {
 	LDObjectPtr obj = parseLine (code());
-	parent()->document()->insertObj (index(), obj);
+	parent()->document().toStrongRef()->insertObj (index(), obj);
 	g_win->R()->compileObject (obj);
 }
 
@@ -155,7 +155,7 @@
 void DelHistory::undo() const
 {
 	LDObjectPtr obj = parseLine (code());
-	parent()->document()->insertObj (index(), obj);
+	parent()->document().toStrongRef()->insertObj (index(), obj);
 	g_win->R()->compileObject (obj);
 }
 
@@ -163,7 +163,7 @@
 //
 void DelHistory::redo() const
 {
-	LDObjectPtr obj = parent()->document()->getObject (index());
+	LDObjectPtr obj = parent()->document().toStrongRef()->getObject (index());
 	obj->destroy();
 }
 

mercurial