One thing with Assigned and FreeAndNil. They both work fine only if your right correct code.
assigned will always return true if the integer value of the pointer is not zero. this does not mean the object is a valid reference, so calling free will crash. Assigned is designed to be used before accessing an object pointer, not before freeing it. ie O := TObject.Create; //valid pointer; Assigned(o) // true; o.free; assigned(o) // still true; o.free // crash --------------------------------- O := TObject.Create; //valid pointer; Assigned(o) // true; freeandnil(o); assigned(o) // now false; o.free // no crash ---- so use assigned to test validity on objects before using them, but to do it before freeing is pointless. it is either valid and freeable, or nil and safe, or invalid and crashes. this just tells us that to be safe you should initialize all pointers before use and after use... -----Original Message----- From: Max Nilson [mailto:[EMAIL PROTECTED] Sent: Monday, 3 March 2003 3:15 p.m. To: Multiple recipients of list delphi Subject: RE: [DUG]: Freeing Stringlists. Neven MacEwan commented: > Max > > a 100! as many as that? :-) Well that's just a wild ass guess of the top of my head 8-) If you are wanting a CPU by CPU break down of the theoretical cycle count, followed by a discussion of various effects different levels of caching, memory architecture, code alignment, and current CPU virtualisation level may have your've come to the wrong place. Cheers, Max. --------------------------------------------------------------------------- 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/ --------------------------------------------------------------------------- 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/
