mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 18:43:37 +00:00
Fix bug discovered by Kornel. See
http://marc.info/?l=lyx-devel&m=138590578911716&w=2 If you look at Buffer.cpp, around line 4351, there was a comment about bug 5699. We are seeing the same crash. The problem is that, although the master does have a GUI, that GUI is in a different window. So the structureChanged() call we do during updateBuffer() is for the TOC in that window, not the TOC in the window we are actually in. So our TocModel::toc_ has been reset and is invalid, though the widget itself has not been updated and looks fine. This patch tests whether the master is in the same window as the buffer we are updating. A problem remains, which is noted in a comment.
This commit is contained in:
parent
f9de88c53c
commit
3f62601a8f
@ -4348,9 +4348,15 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
|
|||||||
if (master != this) {
|
if (master != this) {
|
||||||
bufToUpdate.insert(this);
|
bufToUpdate.insert(this);
|
||||||
master->updateBuffer(UpdateMaster, utype);
|
master->updateBuffer(UpdateMaster, utype);
|
||||||
// Do this here in case the master has no gui associated with it. Then,
|
// If the master buffer has no gui associated with it, then the TocModel is
|
||||||
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
|
// not updated during the updateBuffer call and TocModel::toc_ is invalid
|
||||||
if (!master->d->gui_)
|
// (bug 5699). The same happens if the master buffer is open in a different
|
||||||
|
// window. This test catches both possibilities.
|
||||||
|
// See: http://marc.info/?l=lyx-devel&m=138590578911716&w=2
|
||||||
|
// There remains a problem here: If there is another child open in yet a third
|
||||||
|
// window, that TOC is not updated. So some more general solution is needed at
|
||||||
|
// some point.
|
||||||
|
if (master->d->gui_ != d->gui_)
|
||||||
structureChanged();
|
structureChanged();
|
||||||
|
|
||||||
// was buf referenced from the master (i.e. not in bufToUpdate anymore)?
|
// was buf referenced from the master (i.e. not in bufToUpdate anymore)?
|
||||||
|
Loading…
Reference in New Issue
Block a user