]> git.lyx.org Git - features.git/commitdiff
two additional fixes, one of them is really suspect...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 3 Feb 2000 19:08:24 +0000 (19:08 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 3 Feb 2000 19:08:24 +0000 (19:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@524 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/lyxrow.h
src/text2.C

index 07364ccb11b48469424d626475c0e993b840bf63..597439972dfdf01dd109f5f7287c95af028650ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2000-02-03  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
+       * src/lyxrow.h: make sure that all Row variables are initialized.
+
+       * src/text2.C (TextHandleUndo): comment out a delete, this might
+       introduce a memory leak, but should also help us to not try to
+       read freed memory. We need to look at this one.
+
        * src/paragraph.C (SimpleDocBookOneTablePar): initialize column to 0
        (LyXParagraph): initalize footnotekind.
 
index e90d27caac7a0270a0961da6ebcd5ed7eef8ccf5..199ca99f3063f7c2f2e95a55d0c793d791090320 100644 (file)
 ///
 struct Row {
        ///
+       Row()
+               : par(0), pos(0), baseline(0), fill(0), height(0),
+                 ascent_of_text(0), next(0), previous(0)
+               {}
+       ///
        LyXParagraph * par;
        ///
        LyXParagraph::size_type pos;
index 4ad2ec1f57544ad936fe930af03449ad589ac116..8903d40b852348bfd375361a9e1de8ec90c2f00f 100644 (file)
@@ -3427,13 +3427,15 @@ bool LyXText::TextHandleUndo(Undo * undo)
                                if (undo->kind == Undo::EDIT){
                                        tmppar2->text = tmppar->text;
                                        tmppar->text.clear();
-                                       //tmppar->text.erase(tmppar->text.begin(),
-                                       //                 tmppar->text.end());
                                        tmppar2 = tmppar2->next;
                                }
                                if ( currentrow && currentrow->par == tmppar )
                                        currentrow = currentrow -> previous;
-                               delete tmppar;
+                               // Commenting out this might remove the error
+                               // reported by Purify, but it might also
+                               // introduce a memory leak. We need to
+                               // check this (Lgb)
+                               //delete tmppar;
                        }
                }