From f1f99a0a16f5d4f2d992adbbf35ec449f95f7d15 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Thu, 3 Feb 2000 19:08:24 +0000 Subject: [PATCH] two additional fixes, one of them is really suspect... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@524 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 6 ++++++ src/lyxrow.h | 5 +++++ src/text2.C | 8 +++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07364ccb11..597439972d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2000-02-03 Lars Gullik Bjønnes + * 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. diff --git a/src/lyxrow.h b/src/lyxrow.h index e90d27caac..199ca99f30 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -17,6 +17,11 @@ /// 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; diff --git a/src/text2.C b/src/text2.C index 4ad2ec1f57..8903d40b85 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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; } } -- 2.39.2