-----Original Message-----
From: Andreas Toth [mailto:[EMAIL PROTECTED]
Sent: Monday, 3 March 2003 9:25 a.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Freeing Stringlists.The F-prefix has nothing to do with it being a form-level variable. The F indicates that the variable is a class-level **field**, hence the F-prefix. It's just a coincidence that "form" starts with F.-Andreas-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of James Low
Sent: Monday, 3 March 2003 09:02
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Freeing Stringlists.The obvious questions are:
1) What is the scope of the string lists? I am pretty sure that is they are form level the convention is to prefix them with an f ... are they form level?
2) Are you passing the string lists about and destroying them without knowing?
I would pop a breakpoint on the first free and inspect the object prior to its destruction. Perhaps even place a watch on it.
-----Original Message-----
From: Alistair George [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 1 March 2003 1:17 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Freeing Stringlists.
Hi all.
I have a lot of trouble freeing string list. they are created in formcreate:
procedure TMainform.FormCreate(Sender: TObject);
var fversion: string;
begin
Appath := IncludeTrailingBackSlash(ExtractFilePath(Application.EXEName));
mainform.HelpFile := appath + 'back4winxp.hlp';
VCLzip1.DoProcessMessages := true;
VCLzip1.FileOpenMode := fmOpenRead or fmShareDenyNone;
TheReasonSummary := Tstringlist.Create;
IncludeList := Tstringlist.Create;
ZIPfiles := Tstringlist.Create;But in either case below, they cause a memory error when I close the form
if they have not been used (below are in FormClose):
try IncludeList.Free; except end;
try ZIPfiles.Free; except end;
try TheReasonSummary.Free; except end;try
if sizeof(includelist) > 0 then IncludeList.Free;
if sizeof(ZIPfiles) > 0 then ZIPfiles.Free;
if sizeof(TheReasonSummary) > 0 then TheReasonSummary.Free;
except end;
The only working way I find is as follows:
IncludeList:=nil;
ZIPfiles:=nil;
TheReasonSummary:=nil;
Comments????
---------------------------------------------------------------------------
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/
Notice of Legal Status and Confidential Information: This electronic mail message and any accompanying attachments may contain information that is privileged and CONFIDENTIAL. If you are not the intended recipient you are advised that any use, review, dissemination, distribution or reproduction of the information is strictly prohibited and may be unlawful. If you have received this document in error, please notify the sender immediately and destroy the message.
Notice of Legal Status and Confidential Information: This electronic mail message and any accompanying attachments may contain information that is privileged and CONFIDENTIAL. If you are not the intended recipient you are advised that any use, review, dissemination, distribution or reproduction of the information is strictly prohibited and may be unlawful. If you have received this document in error, please notify the sender immediately and destroy the message.
