Yes. This is exactly how I have normally done it. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Johnson Sent: Thursday, September 06, 2007 3:01 PM To: Discussion of advanced .NET topics. Subject: Re: [ADVANCED-DOTNET] l immediately release any unneeded memory
On 9/6/07, Russell Collins <[EMAIL PROTECTED]> wrote: > > > However, if a Finalizer is used, the GC.SupressFinalize() method will > speed up the process of cleaning up resources by not calling the > finalizer. Better yet, implement the IDisposable interface and do > your clean up there. > Yes. Implement IDisposable, call Dispose from Finalize (destructor), call GC.SuppressFinalize(this) from Dispose. This way, if Dispose is called, as it should be, the finalizer never needs to run. -- Steve Johnson =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com