Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using IDisposable
Message
From
21/11/2008 17:03:01
 
 
To
21/11/2008 16:47:31
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Miscellaneous
Thread ID:
01363570
Message ID:
01363582
Views:
9
Yikes. This doesn't sound good. What are you doing that you need major garbage collection? Do you have a link for this quote?

>I don't know Craig, I am having one of those days when I don't know what is right anymore. I just finished reading an article by a respected source that says and I quote
>"The most important point to remember if you supply a destructor is that you cannot predict when it will be called - it will only be executed when the garbage collector runs and removes it from memory. It is for this reason that if you have any expensive unmanaged resources to release when your class is destroyed, it is preferable to dispose of them in a Close() or Dispose() method that can be called explicitly by the user of the class. In actual fact, we can never guarantee that a destructor will ever be called since we can tell the garbage collector NOT to call an object's destructor with the SuppressFinalize method of the System.GC class.
>Does this insure my method would be called?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform