]> git.lyx.org Git - features.git/commitdiff
Fix crash when closing a child document after having played with the Preference dialog.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 9 Jul 2007 16:52:09 +0000 (16:52 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 9 Jul 2007 16:52:09 +0000 (16:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19015 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/LyXView.cpp

index 095a351c799029d64ba11c040350c93672ec7f38..b844156ebdcc75767be5b04172438548a3368626 100644 (file)
@@ -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.