commit 231ce1ce1719f57e47abd8b227a6ccacc9f0c339
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri Aug 28 19:46:35 2026 +0200

    Fix crash due to dangling pointers when closing complex masters (#13358)
---
 src/Buffer.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index c17ff1f76a..5b339b4837 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3763,6 +3763,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);
+               // The buffer might have been closed (see #13358).
+               if (!theBufferList().isLoaded(child))
+                       continue;
                // No duplicates
                ListOfBuffers::const_iterator bit = find(children.begin(), 
children.end(), child);
                if (bit != children.end())
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to