From: Abdelrazak Younes Date: Mon, 9 Jul 2007 16:52:09 +0000 (+0000) Subject: Fix crash when closing a child document after having played with the Preference dialog. X-Git-Tag: 1.6.10~9185 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=19e12e5fab5d019495c59cbe4c3cba430e8dcdfd;p=features.git Fix crash when closing a child document after having played with the Preference dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19015 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/LyXView.cpp b/src/frontends/LyXView.cpp index 095a351c79..b844156ebd 100644 --- a/src/frontends/LyXView.cpp +++ b/src/frontends/LyXView.cpp @@ -163,6 +163,17 @@ void LyXView::setBuffer(Buffer * b, bool child_document) connectBuffer(*newBuffer); + /* FIXME: We need to rebuild the Toc dialog before the others even + if it will be rebuilt again in the next line. This avoid a crash when + other dialogs are rebuilt before the Toc dialog. The reason is + that closing a Buffer triggers an update of all opened dialogs + when dispatching LFUN_DIALOG_UPDATE (hence the patch). + The path is as following: + setBuffer() -> updateBufferDependent() -> RestoreButton() -> LFUN + The problem here is that the Toc dialog has not been + reconstructed (because it comes after in the list of dialogs). */ + updateToc(); + // Buffer-dependent dialogs should be updated or // hidden. This should go here because some dialogs (eg ToC) // require bv_->text.