Bo Peng wrote:
Here's how I see it,

Your analysis is the same as mine...

And I actually get the crash in this vicinity.

Great. I was not able to reproduce it under linux.

I'm trying this:
Index: src/frontends/LyXView.cpp
===================================================================
--- src/frontends/LyXView.cpp   (revision 19264)
+++ src/frontends/LyXView.cpp   (working copy)
@@ -133,10 +133,8 @@
        // parentfilename will be used in case when we switch to a child
        // document (hence when child_document is true)
        string parentfilename;
-       if (oldBuffer) {
+       if (oldBuffer)
                parentfilename = oldBuffer->fileName();
-               disconnectBuffer();
-       }

        if (!b && theBufferList().empty())
                getDialogs().hideBufferDependent();
@@ -160,7 +158,8 @@
                        // must update the labels and section numbering
of its master
                        // Buffer.
                        updateLabels(*oldBuffer->getMasterBuffer());
-
+               if (oldBuffer)
+                       disconnectBuffer();
                connectBuffer(*newBuffer);

I just posted another patch. I am not sure which is better. My
understanding is that because master doc is responsible for updating
Toc for itself, and all its child documents, the strctureChanged()
signal should always be connected to a master buffer, even if it is
not the current buffer.
I think structureChanged() could possibly be used for other stuff, too, though it's not at present. The call in ControlToc::updateBackend() goes to the current buffer, though, which may have its own TOC, right?

Richard

--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to