From: Jean-Marc Lasgouttes Date: Thu, 18 Feb 2021 14:35:42 +0000 (+0100) Subject: Fix a crash when closing tabs X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=65b674ba4eff34df1ef7a7cf0f9e6a2585294c00;p=features.git 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 https://gitlab.com/gadmm/lyx-unstable/-/commit/261ce4ea98d82625a07f0fcf85e40f9055d2db3b --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8414efa204..5c7b88682b 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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(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())