]> git.lyx.org Git - features.git/commitdiff
the right fix for the invalid iterators (plural)
authorAllan Rae <rae@lyx.org>
Tue, 19 Feb 2002 03:16:10 +0000 (03:16 +0000)
committerAllan Rae <rae@lyx.org>
Tue, 19 Feb 2002 03:16:10 +0000 (03:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3567 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView2.C
src/ChangeLog

index a59f737df8d1a53236a2512081fdb4e21089d753..35e0a4b1f33385f659bdbb05056fa6e3b0b75c29 100644 (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;
index 055c69a0fe5b444ac96dabc6bed29f43b7c3069a..7c8f0dac538befc9a6a2f85596b5cca3450ddc87 100644 (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: