From 6a85b8a96e28057244ed749e7cd645518dcda781 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 29 Sep 2010 12:30:31 +0000 Subject: [PATCH] I am pretty sure we do not want duplicates here. What's worse, recursive includes could crash this if we allow them. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35534 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index bfcac85256..26e9af733a 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2527,6 +2527,10 @@ void Buffer::getChildren(ListOfBuffers & clist, bool grand_children) const Impl::BufferPositionMap::iterator end = d->children_positions.end(); for (; it != end; ++it) { Buffer * child = const_cast(it->first); + // No duplicates + ListOfBuffers::const_iterator bit = find(clist.begin(), clist.end(), child); + if (bit != clist.end()) + continue; clist.push_back(child); if (grand_children) // there might be grandchildren -- 2.39.5