]> git.lyx.org Git - features.git/commitdiff
Cursor::insert(): Fix crash with math. Problem was that the inset pointer was release...
authorAbdelrazak Younes <younes@lyx.org>
Fri, 29 Feb 2008 20:55:56 +0000 (20:55 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 29 Feb 2008 20:55:56 +0000 (20:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23363 a592a061-630c-0410-9148-cb99ea01b6c8

src/Cursor.cpp

index 4c833c32de99118f19ce9eb43fe8e425f73a8c67..0854e242ae07269116e92755df9e02efda57f782 100644 (file)
@@ -1019,13 +1019,14 @@ void Cursor::insert(MathAtom const & t)
 }
 
 
-void Cursor::insert(Inset * inset)
+void Cursor::insert(Inset * inset0)
 {
+       BOOST_ASSERT(inset0);
        if (inMathed())
-               insert(MathAtom(inset));
+               insert(MathAtom(inset0));
        else
-               text()->insertInset(*this, inset);
-       inset->setBuffer(bv_->buffer());
+               text()->insertInset(*this, inset0);
+       inset().setBuffer(bv_->buffer());
 }