There are no destructors, there are finalizers (as your code shows). The
difference is what destructor in C++ is always called before class is
destroyed and finalizers might never be called and even if they are called
you can never predict when that would happened. That is why you have to call
(or implement) Dispose() instead of using finalizers.
If your class uses native resources then you have to implement IDisposable
interface correctly and call it from finalizer with "false" as argument:
Protected Overrides Sub Finalize()
Dispose(false)
End Sub
That argument means "Do NOT touch any managed objects" because they might be
already collected.
If you don't use any native resources in your class then you don't need to
implement IDispossable and you don't need finalizer.
See this for more info:
http://weblogs.asp.net/cnagel/archive/2005/01/23/359037.aspx
--
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no rights.
*** Want to find answers instantly? Here's how... ***
1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).