Fix a crash when closing tabs

Although I do not know how to reproduce the crash, the change makes sense.

This is backported from gadmm's lyx-unstable tree
261ce4ea98
This commit is contained in:
Jean-Marc Lasgouttes 2021-02-18 15:35:42 +01:00
parent 9ee73dbb30
commit 65b674ba4e

View File

@ -3538,6 +3538,9 @@ void Buffer::collectChildren(ListOfBuffers & children, bool grand_children) cons
// loop over children
for (auto const & p : d->children_positions) {
Buffer * child = const_cast<Buffer *>(p.first);
// This can happen when called during GUI operations
if (!theBufferList().isLoaded(child))
continue;
// No duplicates
ListOfBuffers::const_iterator bit = find(children.begin(), children.end(), child);
if (bit != children.end())