|
| |
User Groups : Forums : SiteExperts : Microsoft .NET
:  | Dispose() vs null Ok, I hope some of the folks who used to post on here still do, and I hope you see this. I know this site has been overrun with spam lately, so that you guys don't come here much, but I have a serious C# question.
Ok, let's say I create a class in C# called MyClass
Now, let's say in a code-behind, I reference it like this:
MyClass objMC = new MyClass();
And then I do whatever I need to do with it.
When I'm done, I want the GC to clean it up.
What's the difference in using something like
objMC.Dispose();
versus
objMC = null;
I understand that to use Dispose() I have to add some additional code (including a destructor, ~MyClass) to the class itself.
But what's the "behind the scenes" difference, and which one is better to use?Started By Monte on Dec 12, 2008 at 12:57:53 PM |  | | 15 Response(s) | Reply |
To respond to a discussion, you must first logon.
If you are not registered, please register yourself to become a member of the SiteExperts.community.
|