throw exception in the finalize

Z

z. f.

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

avnrao

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top