]> git.lyx.org Git - features.git/commitdiff
Fix a crash due to Inset**::mouse_hover_[] containing an invalid pointer to a BufferView.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 3 May 2010 23:04:51 +0000 (23:04 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 3 May 2010 23:04:51 +0000 (23:04 +0000)
Clear the mouse_hover state when closing the BufferView. Otherwise, there will be an invalid pointer stored in the Inset and crashing LyX when the Inset's destructor is called.

See also r33908, r34117, r34348, r34353, r34354, r34363 and bug #3900.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34365 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index 3050a7b498e5d03b1674cfa47726e76666bd17c2..9d7af3bbad6e9eb6bf38c41d9ffc2c75c8d27395 100644 (file)
@@ -315,6 +315,9 @@ BufferView::~BufferView()
        fp.pit = d->cursor_.bottom().pit();
        fp.pos = d->cursor_.bottom().pos();
        theSession().lastFilePos().save(buffer_.fileName(), fp);
+       
+       if (d->last_inset_)
+               d->last_inset_->setMouseHover(this, false);     
 
        delete d;
 }