From 27c61a0405a0f4a4bdd050f2ade9fc410ad00217 Mon Sep 17 00:00:00 2001 From: vincents Date: Thu, 28 Apr 2005 11:50:56 +0000 Subject: [PATCH] fixed memleak git-svn-id: trunk@7112 - --- doceditor/frmmain.pp | 9 ++++----- doceditor/pkeditor.pp | 5 ----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/doceditor/frmmain.pp b/doceditor/frmmain.pp index 2afbd9ee7b..60d4353fb0 100644 --- a/doceditor/frmmain.pp +++ b/doceditor/frmmain.pp @@ -531,16 +531,15 @@ Var begin FRecent.Clear; - With TInifile.Create(GetoptionFileName) do - begin + With TInifile.Create(GetoptionFileName) do begin Count:=ReadInteger('Recent','Count',0); - For I:=1 to Count do - begin + For I:=1 to Count do begin S:=ReadString('Recent','File'+IntToStr(i),''); If S<>'' then FRecent.Add(S); - end; end; + Free; + end; BuildReopenList; end; diff --git a/doceditor/pkeditor.pp b/doceditor/pkeditor.pp index c893554d0e..3e6ca0631a 100644 --- a/doceditor/pkeditor.pp +++ b/doceditor/pkeditor.pp @@ -195,7 +195,6 @@ end; procedure TCustomPackageEditor.SetCurrentModule(Value: TDomElement); begin -//matthijs 10-4-2005 19:16 added checks on Value and Value.ParentNode if (Value <> nil) then begin if (Value.ParentNode <> nil) then begin CurrentPackage:=Value.ParentNode as TDomElement; @@ -873,9 +872,6 @@ begin P:=FModuleNode; Result:=SubNodeWithElement(P,E); end; -//matthijs 10-4-2005 19:22 Made next two lines comments. -// If (Result=Nil) then -// Raise Exception.CreateFmt(SErrNoNodeForElement,[E['name']]); end; Procedure TPackageEditor.AddElement(E : TDomElement); @@ -969,7 +965,6 @@ end; Procedure TPackageEditor.SetCurrentElement(E : TDomElement); begin -//matthijs 10-4-2005 19:27 Added Check on E = nil. If (E<>FCurrentElement) and (E <> nil) then begin Inherited;