Home All Groups Group Topic Archive Search About
Author
11 Aug 2006 1:43 PM
myname
Hello,

I noticed that when there's a crash in my programs,
the finalize methods of my objects are not called
(the memory is freed, but some things are not done,
like deleting files or tables).

Of course, I should handle all the exceptions,
but in the case I forget some of them,
is there any way to make sure the finalize
methods are always called ?

Thanks !

Author
11 Aug 2006 2:12 PM
Cor Ligthert [MVP]
Myname,

What do you call the finalize methods?
Are you sure your problem is about Visual Basic Net?


Cor

Show quoteHide quote
"myname" <nospam@ihatespam.com> schreef in bericht
news:44dc86e5$1@news.sncf.fr...
> Hello,
>
> I noticed that when there's a crash in my programs,
> the finalize methods of my objects are not called
> (the memory is freed, but some things are not done,
> like deleting files or tables).
>
> Of course, I should handle all the exceptions,
> but in the case I forget some of them,
> is there any way to make sure the finalize
> methods are always called ?
>
> Thanks !
>
>
Author
11 Aug 2006 2:29 PM
Herfried K. Wagner [MVP]
"myname" <nospam@ihatespam.com> schrieb:
> I noticed that when there's a crash in my programs,
> the finalize methods of my objects are not called
> (the memory is freed, but some things are not done,
> like deleting files or tables).
>
> Of course, I should handle all the exceptions,
> but in the case I forget some of them,
> is there any way to make sure the finalize
> methods are always called ?

No, you cannot, because the process can be terminated using the task manager
immediately.  What you can do is check data integrity upon startup.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>