On Thu, Aug 28, 2003 at 03:49:47PM +0200, Michael Schmitt wrote:
> Hello,
> 
> whenever I edit some math formula (in an otherwise empty doc) and close 
> the document afterwards, the following valgrind report (and many more) 
> appears:
> 
> ==28940== Invalid read of size 4
> ==28940==    at 0x8192E8E: MathCursor::info() const (math_cursor.C:1298)
> ==28940==    by 0x80D54F7: bv_funcs::currentState(BufferView*) 
> (bufferview_funcs.C:295)
> ==28940==    by 0x811815D: LyXFunc::view_status_message() (lyxfunc.C:1966)
> ==28940==    by 0x8282ADB: QtView::update_view_state_qt() (QtView.C:129)
> ==28940==    by 0x8282A84: QtView::clearMessage() (QtView.C:116)
> ==28940==    by 0x8067B51: BufferView::Pimpl::resizeCurrentBuffer() 
> (BufferView_pimpl.C:484)
> ==28940==    by 0x8066FA9: BufferView::Pimpl::buffer(Buffer*) 
> (BufferView_pimpl.C:324)
> ==28940==    by 0x8062122: BufferView::buffer(Buffer*) (BufferView.C:107)
> ==28940==    by 0x8117FCD: LyXFunc::closeBuffer() (lyxfunc.C:1919)
> ==28940==    by 0x8112C1B: LyXFunc::dispatch(FuncRequest const&, bool) 
> (lyxfunc.C:1087)
> ==28940==    Address 0x437F5A00 is 0 bytes inside a block of size 100 free'd
> ==28940==    at 0x4004BDA1: __builtin_delete (vg_replace_malloc.c:233)
> ==28940==    by 0x4004BDBF: operator delete(void*) (vg_replace_malloc.c:242)
> ==28940==    by 0x81B1E3F: MathHullInset::~MathHullInset() 
> (math_hullinset.C:476)
> ==28940==    by 0x818EC8A: MathAtom::~MathAtom() (math_atom.C:49)
> ==28940==    by 0x8189C0F: InsetFormula::~InsetFormula() (formula.C:110)
> ==28940==    by 0x8082803: InsetList::~InsetList() (InsetList.C:52)
> ==28940==    by 0x81389BB: Paragraph::~Paragraph() (paragraph.C:126)
> ==28940==    by 0x80754F2: void std::_Destroy<Paragraph>(Paragraph*) 
> (/usr/include/g++/bits/stl_construct.h:125)
> ==28940==    by 0x807547E: std::_List_base<Paragraph, 
> std::allocator<Paragraph> >::__clear() (/usr/include/g++/bits/list.tcc:77)
> ==28940==    by 0x80C5314: std::list<Paragraph, 
> std::allocator<Paragraph> >::clear() (/usr/include/g++/bits/stl_list.h:919)
> 
> ==28940==    at 0x8192E8E: MathCursor::info() const (math_cursor.C:1298)
> 1298                    Cursor_[i].inset_->infoize(os);
> 
> Maybe you have more ideas on what is going on than me :-)

I guess that's the destruct of a paragraph containing the formula with
the mathcursor. The math cursor should be destroyed at that point...

Well, I guess one could call 

void releaseMathCursor(BufferView * bv);

if a buffer is closed to be on the safe side.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to