]> git.lyx.org Git - features.git/commitdiff
Add check for recursive includes.
authorRichard Heck <rgheck@comcast.net>
Sat, 16 Jul 2011 13:50:06 +0000 (13:50 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 16 Jul 2011 13:50:06 +0000 (13:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39330 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
status.20x

index 238225bcb38492f4687cd1fe9f7d412bc8264873..f3d76b98efe53fd87b061204b05ffc4847439e6b 100644 (file)
@@ -2568,6 +2568,10 @@ void Buffer::collectChildren(ListOfBuffers & clist, bool grand_children) const
                        // there might be grandchildren
                        child->collectChildren(clist, true);
        }
+       // Make sure we have not included ourselves.
+       ListOfBuffers::iterator bit = find(clist.begin(), clist.end(), this);
+       if (bit != clist.end())
+               clist.erase(bit);
 }
 
 
index 3c86fa10f4a916da431f13be785afa518f2a5aa0..ff0c72e4062d43ee037b186624c178b295200ef8 100644 (file)
@@ -156,6 +156,10 @@ What's new
 
 - Fix output of unicode math from within child documents (bug 7682).
 
+- Added a check for recursive includes that should prevent some of the
+  crashes we see in such cases.
+
+
 * USER INTERFACE
 
 - Fixed crash relating to outliner and mouse movement.