BS> Maybe somebody can clear up my confusion. I somehow got the impression
BS> that in Delphi/Windows, unlike TP/DOS, any memory allocated dynamically
BS> with GetMem() or New() is not automatically returned to the system when
BS> the program exits. In other words, in Delphi, you have to free it
BS> yourself with FreeMem/Dispose.
GW> Windows will automatically free allocated memory when a program exits
GW> properly. That doesn't mean that you should not do your own release of
GW> memory.
I'm still (more) confused. If Windows releases allocated memory
when a program terminates, and if a Heap area isn't being reused within
the program's execution, why _should_ you burden the program code with
(seemingly extraneous) Dispose/FreeMem calls which do nothing functional
for the program?
Believe me, I know the value/use of Dispose/FreeMem on TP/BP (I
moderate the Pascal_Lessons echo), but are you saying that Delphi has
different rules than them for their use?
... Beer nuts: The dreaded final stage of cotton balls.
--- OMX/Blue Wave/DOS v2.20
---------------
* Origin: Mike's Place (1:114/307.0)
|