> Fastream Technologies wrote:
> > Interesting. Well I am using classes with string properties and I thought
> > the destructor of the AnsiString class cleans up the memory before
> > releasing it.
>
> Correct, in classes you don't need to release memory allocated for strings.
> But you need to finalize records containing dynamic strings, FreeMem or 
> Dispose
> won't do this job.

I don't agrre with you.
New/Dispose will do the job if they have the correct pointer datatype.
For example if you have a TList with pointers to record, doing:
Dispose(MyList[I]); won't correctly finalize dynamic members (long string and 
others) in the record.
Doing:
Dispose(TMyRecord(MyList[I])); will correctly finalize the record.

If you want to use GetMem/FreeMem, you must call Initialize() and Finalize() 
procedure yourself. See
Delphi online help for more details.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to