By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,881 Members | 1,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,881 IT Pros & Developers. It's quick & easy.

Dispose and Finalize - When to use

P: n/a
I have two questions;

1)When should one use Dispose on objects

2)Is the Finalize Overrides sub needed in classes and if so, when and why?

Thanks for any clarification on these two items.

--
Dennis in Houston
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Some guidelines on using dispose and finalize:
http://msdn.microsoft.com/library/de...izedispose.asp

A couple of blog posts on Dispose:
http://blogs.msdn.com/clyon/archive/...21/232445.aspx
http://blogs.msdn.com/clyon/archive/...23/233464.aspx

Articles on how GC handles objects with a finalized method (and more on GC):
http://msdn.microsoft.com/msdnmag/issues/1100/GCI/
http://msdn.microsoft.com/msdnmag/is...2/default.aspx
hope that helps..
Imran.

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
I have two questions;

1)When should one use Dispose on objects

2)Is the Finalize Overrides sub needed in classes and if so, when and why?

Thanks for any clarification on these two items.

--
Dennis in Houston

Nov 21 '05 #2

P: n/a
Thanks. I"ll read the links and see what I can understand.

"Imran Koradia" wrote:
Some guidelines on using dispose and finalize:
http://msdn.microsoft.com/library/de...izedispose.asp

A couple of blog posts on Dispose:
http://blogs.msdn.com/clyon/archive/...21/232445.aspx
http://blogs.msdn.com/clyon/archive/...23/233464.aspx

Articles on how GC handles objects with a finalized method (and more on GC):
http://msdn.microsoft.com/msdnmag/issues/1100/GCI/
http://msdn.microsoft.com/msdnmag/is...2/default.aspx
hope that helps..
Imran.

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
I have two questions;

1)When should one use Dispose on objects

2)Is the Finalize Overrides sub needed in classes and if so, when and why?

Thanks for any clarification on these two items.

--
Dennis in Houston


Nov 21 '05 #3

P: n/a
Dennis,

The most simple answers,

1)When should one use Dispose on objects
When it is written that you should
2)Is the Finalize Overrides sub needed in classes and if so, when and why?

The same answer as above, otherwise never.

I hope this helps?

Cor


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.