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.

It seems that lyx_view_->currentBufferView() can become NULL after
lyx_view_->dispatch(cmd) and I wonder whether this can happen somewhere
else, too...

I see... This is because the BufferView pointed by bv does not exist anymore. Good catch.

 In other words, is it safe taking a snapshot of
lyx_view_->currentBufferView() and use that thereafter?

It is not indeed and your patch is good. We should probably do the same for buffer and doc_buffer...

Abdel.

Reply via email to