> Still tracing...

The problem is found:

1. updateToc is triggered by signal structureChange, which is needed
to validate references in the Toc dialog.

2. signal structureChange is connected to the master buffer at first

3. when the first child is loaded, the master buffer is still
connected, and updateToc is called correctly

4. however, in lyxview::setBuffer(), the master is disconnected after
the first child is loaded

        if (oldBuffer) {
                parentfilename = oldBuffer->fileName();
                disconnectBuffer();
        }

5. when the second child is loaded,
updateLabels(*newBuffer->getMasterBuffer()); (line 228, lyxview.cpp)
does not update toc, because the master buffer is disconnected.

6. then, when the toc dialog is used, invalidated reference is used,
and msvc asserts.

I can confirm that if I comment out the above disconnectBuffer() call,
lyx will not crash. Now I need to know why we disconnectBuffer()
their, and what would be a proper fix. Another possible fix is not
call setBuffer until all child documents are loaded.

Cheers,
Bo

Reply via email to