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

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

> 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?).


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...


   Jon Hylands      Jon at

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)

More information about the Squeak-dev mailing list