On 07/07/2010 14:25, Andrew Brunner wrote:
On Wed, Jul 7, 2010 at 8:05 AM, Martin<f...@mfriebe.de>  wrote:
if " obj1.free; " crashes, then yes obj2 is not going to be released. But as
explained in this and my last mail: It should not be attempted to be
released.

Martin, I can't disagree more.  I find it completely ludicrous that if
obj1.free raises an exception you should just trow the baby out with
the bath water.  If Obj1.Free raised an exception because a disk drive
was unmounted... Inspect the log... Handle the exception... And fix
the problem.  Future instances will be handled and all is good.  It is
my belief that the notion of skipping exception handling and
restarting an application is very bad practice.
Had you only read to the end of my mail..... You are deliberately ignoring part of what I wrote and the blame me for the remainder being incomplete?

I clearly stated that there are cases where "free" can raise a valid exception, and that the developper has to know this cases, and handle them (with nested try blocks).

But I also wrote that (for me) the rule is that most "free" are not expected to do so (that may of course be totally different in your code).

Martin
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to