BS> On 24 Dec 96 Gary Weinfurther said to Bryan Smith...
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.
BS> Thanks to yourself and to Lee Aroner for the re-assurance that the weird
> effect I thought I had observed was not paranormal.
BS> Can you please define "exit properly" a bit more closely ? Is "properly"
> anything better than a GPF, e.g does "halt" constitute a proper exit ?
r
> does it have to be at least "application.terminate" ?
In the DOS versions of Pascal, a halt was acceptable, unless you
had been using extensions like EMS or XMS...the system module
told DOS to reclaim all the memory that had been allocated
by/from the OS.
The same behavour holds for windows, although a controlled
shutdown in any environment is *always* to be preferred,
specially if you have files open.
For Delphi, application.terminate or closing the main form is the
preferred shutdown method, after writing any data that needs to
be saved and closing all open files. I usually point to such code
in my exception handlers if things get dicey.
BS> If the memory is released by Windows rather than the Delphi program,
aybe
> even a GPF is adequate ?
Well, judging by their offerings, the boys at MS obviously
feel that way....
L.A.
-- SPEED 2.00 #2720: Do not remove this tag under penalty of law.
--- Platinum Xpress/Win/Wildcat5! v2.0GY
---------------
* Origin: Grey Matter : (206) 526-2400 (1:343/210)
|