finalisation

Jon Hylands jon at huv.com
Tue Jan 27 02:42:22 UTC 2004


On Tue, 27 Jan 2004 03:27:11 +0100, "Andreas Raab" <andreas.raab at gmx.de>
wrote:

> All I'm
> saying is that there's no reason to put the resource creation into the
> ensured block, as, no matter what you do, if the resource allocation fails
> (and returns anything but that allocated resource) you don't need to handle
> it (the resource hasn't been allocated so why free it?).

Andreas,

Doesn't this assume that the only thing that happens inside the resource
allocation method is in fact the resource allocation.

For instance, when opening a file stream, the file is also registered for
finalization. If this fails (for whatever reason), the resource has been
allocated, but will possibly cause a walkback, and closing the walkback
will not release the resource.

Just a thought...

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com



More information about the Squeak-dev mailing list