Re: throw exception in the finalize

From: avnrao (avn_at_newsgroups.com)
Date: 07/05/04


Date: Mon, 5 Jul 2004 18:06:58 +0530

hi z.f.
I dont know your requirement clearly but based on the fact of finalizer..you
dont have control as to when it gets called. hence try avoid finalization
usage
and use IDisposable interface implementation instead.

Av.

"z. f." <zigi@info-scopeREMSPAM.co.il> wrote in message
news:uSF6evmYEHA.3596@tk2msftngp13.phx.gbl...
> in vb asp.net page i'm overriding the finalize method in order to make
> cleanup.
> if i throw exception there it is not seen on the page.
> probably because the page has already sent to the client.
> is there a way to throw exception on the finalize method in order to check
> that objects were closed, but how do i trace this exception?
>
> TIA, z.
>
>



Relevant Pages

  • Re: exception inside constructors and finalize
    ... > 1.how can we handle exception inside constructors and finalize method? ... try/catch or (for constructors) throws clause - as usual. ...
    (comp.lang.java.help)
  • RE: GC.Collect doesnt trigger finalizers?
    ... not have their Finalize method called. ... In addition, by default, Finalize methods are not ... >> It might have something to do with the way Garbage Collection works. ... >>> Public Sub New ...
    (microsoft.public.dotnet.framework)
  • RE: GC.Collect doesnt trigger finalizers?
    ... finalize method of each object so it notifies your singleton object that it ... > programmatically force the disposing of every objects, ... >>> Public Sub New ...
    (microsoft.public.dotnet.framework)
  • Re: exception inside constructors and finalize
    ... >> 1.how can we handle exception inside constructors and finalize method? ... > try/catch or (for constructors) throws clause - as usual. ...
    (comp.lang.java.help)
  • Re: Dispose must be thread-safe ?
    ... If Dispose was called from program -> the object was reachable at the start ... thread will be blocked by simple reentry protection if ... Finalize, but this simple reentry protection guaranteed to work in all cases ... > You wrote type B and you wrote your Finalize method without any regard ...
    (microsoft.public.dotnet.framework.clr)