Hello Peter et al, the below sounds absolutely spiffing. if the stringlist is not used it will not free properly in the instances i showed. definitely they are not freed elswhere; it is a function of not using them (or another bug in delphi 5). Al+
Monday, March 3, 2003, 8:18:49 AM, you wrote: PS> Try PS> If Assigned (includelist) then PS> FreeAndNil (includelist); PS> Etc PS> Or PS> If includelist <> nil then PS> FreeAndNil (includelist); PS> They are not freed elsewhere are they. PS> Peter Speden PS> -----Original Message----- PS> From: Alistair George [mailto:[EMAIL PROTECTED] PS> Sent: Saturday, 1 March 2003 1:17 p.m. PS> To: Multiple recipients of list delphi PS> Subject: [DUG]: Freeing Stringlists. PS> Hi all. PS> I have a lot of trouble freeing string list. they are created in PS> formcreate: PS> procedure TMainform.FormCreate(Sender: TObject); PS> var fversion: string; PS> begin PS> Appath := PS> IncludeTrailingBackSlash(ExtractFilePath(Application.EXEName)); PS> mainform.HelpFile := appath + 'back4winxp.hlp'; PS> VCLzip1.DoProcessMessages := true; PS> VCLzip1.FileOpenMode := fmOpenRead or fmShareDenyNone; PS> TheReasonSummary := Tstringlist.Create; PS> IncludeList := Tstringlist.Create; PS> ZIPfiles := Tstringlist.Create; PS> But in either case below, they cause a memory error when I close the PS> form PS> if they have not been used (below are in FormClose): PS> try IncludeList.Free; except end; PS> try ZIPfiles.Free; except end; PS> try TheReasonSummary.Free; except end; PS> try PS> if sizeof(includelist) > 0 then IncludeList.Free; PS> if sizeof(ZIPfiles) > 0 then ZIPfiles.Free; PS> if sizeof(TheReasonSummary) > 0 then TheReasonSummary.Free; PS> except end; PS> The only working way I find is as follows: PS> IncludeList:=nil; PS> ZIPfiles:=nil; PS> TheReasonSummary:=nil; PS> Comments???? PS> ------------------------------------------------------------------------ PS> --- PS> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] PS> Website: http://www.delphi.org.nz PS> To UnSub, send email to: [EMAIL PROTECTED] PS> with body of "unsubscribe delphi" PS> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ PS> --------------------------------------------------------------------------- PS> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] PS> Website: http://www.delphi.org.nz PS> To UnSub, send email to: [EMAIL PROTECTED] PS> with body of "unsubscribe delphi" PS> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ -- Regards, Alistair+ --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
