From: Richard Heck Date: Wed, 29 Sep 2010 12:30:31 +0000 (+0000) Subject: I am pretty sure we do not want duplicates here. What's worse, recursive X-Git-Tag: 2.0.0~2476 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6a85b8a96e28057244ed749e7cd645518dcda781;p=lyx.git 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 --- 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