the right fix for the invalid iterators (plural)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3567 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Allan Rae 2002-02-19 03:16:10 +00:00
parent d0a3af12d9
commit 51b32d4984
2 changed files with 11 additions and 1 deletions

View File

@ -191,8 +191,13 @@ bool BufferView::removeAutoInsets()
if (pit->autoDelete()) {
removed = true;
pos_type const pos = pit.getPos();
par->erase(pos);
// get the next valid iterator position
pit = par->InsetIterator(pos);
// ensure we have a valid end iterator
pend = par->inset_iterator_end();
if (cur_par == par) {
if (cur_pos > pos)
--cur_pos;

View File

@ -1,3 +1,8 @@
2002-02-19 Allan Rae <rae@lyx.org>
* BufferView2.C (removeAutoInsets): fix remaining freed memory read.
Iterators might be simple to use but they also get invalidated.
2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
* Chktex.C: