On 7 July 2010 15:25, Andrew Brunner <andrew.t.brun...@gmail.com> wrote:
>
> procedure TObj1.Free;
> begin
>  Disk1.Unmount; <<< The disk object is missing now b/c a network failure;
>  Inherited Destroy;
> end;
>
> procedure TObj1.Free;
> begin
>  Try
>    Disk1.Unmount;
>  Except
>    On E:Exception do begin
>       // Some case stuff here
>    end;
>  end;
>  Inherited Destroy;
> end;
>
> In my example... Your code would blow out an application.  With my
> exception handling the app would continue on as normal with no
> problems.

With the exception of a possible memory leak in case Disk1.Unmount was
supposed to free up some resources. And if your app is something that
runs 24/7, that is a *huge* problem! Eventually you will run out of
memory and the whole thing will come crumbling down (and maybe even
cause more damage).


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to