commit 0871ae84fc59a383ee25e43c69504ee143ec3045
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)
    
    (cherry picked from commit 231ce1ce1719f57e47abd8b227a6ccacc9f0c339)
---
 src/Buffer.cpp | 3 +++
 status.25x     | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 11d3f59121..fee0acde02 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3715,6 +3715,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())
diff --git a/status.25x b/status.25x
index 12540751fe..612b5e9664 100644
--- a/status.25x
+++ b/status.25x
@@ -51,6 +51,8 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
+- Fix crash when closing complex multipart-documents (bug 13358).
+
 - Fix captions of starred theorems (bug 13356).
 
 - Font changes should not be allowed for passthru environment
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to