On Mon, Sep 21, 2009 at 03:04:15PM +0200, Abdelrazak Younes wrote: > Enrico Forestieri wrote: > > On Mon, Sep 21, 2009 at 12:56:03PM +0200, Enrico Forestieri wrote: > > > > > >> On Mon, Sep 21, 2009 at 09:56:21AM +0200, Abdelrazak Younes wrote: > >> > >> > >>> rgheck wrote: > >>> > >>>> On 09/20/2009 05:41 PM, you...@lyx.org wrote: > >>>> > >>>>> Author: younes > >>>>> Date: Sun Sep 20 23:41:21 2009 > >>>>> New Revision: 31419 > >>>>> URL: http://www.lyx.org/trac/changeset/31419 > >>>>> > >>>>> Log: > >>>>> Try to dispatch to document BufferView in case dispatch to current > >>>>> BufferView fails. This is needed for the LFUNs introduced in r31412 > >>>>> URL: http://www.lyx.org/trac/changeset/31412 > >>>>> > >>>>> Modified: > >>>>> lyx-devel/trunk/src/BufferView.cpp > >>>>> lyx-devel/trunk/src/LyXFunc.cpp > >>>>> > >> Abdel, after this commit I get a crash when trying to close a document > >> (File->Close). Backtrace attached. > >> > >> Oddly enough, the crash seems to only happen on Cygwin and only when > >> closing a document, as File->Exit works fine even with a dirty buffer. > >> > > > > The attached patch avoids the crash. > > > > Hum... I just had a look at trunk again and it seems that I already > fixed that one in one of the following revision...
If you mean http://www.lyx.org/trac/changeset/31420 , that is not the same thing... Apply the attached patch and then open and close a document. The current pointer is 0 but bv is not, so the "if (bv)" test succeeds. This seems harmless on both Linux and native Windows but causes a crash on Cygwin. -- Enrico
Index: src/LyXFunc.cpp =================================================================== --- src/LyXFunc.cpp (revisione 31435) +++ src/LyXFunc.cpp (copia locale) @@ -1101,6 +1101,8 @@ void LyXFunc::dispatch(FuncRequest const // Let the current LyXView dispatch its own actions. if (lyx_view_->dispatch(cmd)) { + lyxerr << "Previous bv pointer: " << bv << endl; + lyxerr << "Current bv pointer: " << lyx_view_->currentBufferView() << endl; if (bv) { updateFlags = bv->cursor().result().update(); if (theBufferList().isLoaded(buffer))