Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
QuestionDifference b/w dispose() & finalize() Pin
Dineshraj31-Aug-07 1:48
Dineshraj31-Aug-07 1:48 
AnswerRe: Difference b/w dispose() & finalize() Pin
Colin Angus Mackay31-Aug-07 2:00
Colin Angus Mackay31-Aug-07 2:00 
GeneralRe: Difference b/w dispose() & finalize() Pin
martin_hughes31-Aug-07 2:48
martin_hughes31-Aug-07 2:48 
GeneralRe: Difference b/w dispose() & finalize() Pin
Pete O'Hanlon31-Aug-07 3:12
mvePete O'Hanlon31-Aug-07 3:12 
AnswerRe: Difference b/w dispose() & finalize() Pin
Pete O'Hanlon31-Aug-07 2:07
mvePete O'Hanlon31-Aug-07 2:07 
GeneralRe: Difference b/w dispose() & finalize() Pin
Colin Angus Mackay31-Aug-07 3:12
Colin Angus Mackay31-Aug-07 3:12 
AnswerRe: Difference b/w dispose() & finalize() Pin
Vasudevan Deepak Kumar31-Aug-07 2:31
Vasudevan Deepak Kumar31-Aug-07 2:31 
AnswerRe: Difference b/w dispose() & finalize() Pin
Scott Dorman31-Aug-07 8:18
professionalScott Dorman31-Aug-07 8:18 
First of all, you generally don't want to write a finalizer unless you really need to. There are a lot of rules that should be followed in a finalizer and a lot of assumptions that can normally be made about the state of the objects and the runtime are not valid inside a finalizer. They add a cost to your object as well, even if the finalizer is never called.

That being said, as others have pointed out, Dispose is part of the IDisposable interface and helps implement the Dispose pattern. This pattern provides an explicit method for cleaning up resources.

A finalizer provides for implicit cleanup and, if your class has one, will be automatically called at some non-determistic time as part of the garbage collection process.




Scott.

—In just two days, tomorrow will be yesterday.

[Forum Guidelines] [Articles] [Blog]

AnswerRe: Difference b/w dispose() & finalize() Pin
Scott Dorman31-Aug-07 8:19
professionalScott Dorman31-Aug-07 8:19 
QuestionReceiving Mail from an Exchange Server Pin
Programm3r31-Aug-07 1:20
Programm3r31-Aug-07 1:20 
AnswerRe: Receiving Mail from an Exchange Server Pin
Vasudevan Deepak Kumar31-Aug-07 2:30
Vasudevan Deepak Kumar31-Aug-07 2:30 
Questionhow use Line Break in Gios PDF .NET library [modified] Pin
sanjeevRanjan31-Aug-07 1:07
sanjeevRanjan31-Aug-07 1:07 
AnswerRe: how use Line Break in Gios PDF .NET library Pin
Vasudevan Deepak Kumar31-Aug-07 2:34
Vasudevan Deepak Kumar31-Aug-07 2:34 
Questionquery string encryption Pin
Sonia Gupta31-Aug-07 1:05
Sonia Gupta31-Aug-07 1:05 
AnswerRe: query string encryption Pin
Pete O'Hanlon31-Aug-07 1:08
mvePete O'Hanlon31-Aug-07 1:08 
GeneralRe: query string encryption Pin
Sonia Gupta31-Aug-07 1:32
Sonia Gupta31-Aug-07 1:32 
GeneralRe: query string encryption Pin
Pete O'Hanlon31-Aug-07 1:58
mvePete O'Hanlon31-Aug-07 1:58 
AnswerRe: query string encryption Pin
Vasudevan Deepak Kumar31-Aug-07 2:33
Vasudevan Deepak Kumar31-Aug-07 2:33 
Questionasp.net panel like code project Pin
mfmaneef31-Aug-07 1:02
mfmaneef31-Aug-07 1:02 
AnswerRe: asp.net panel like code project Pin
\laddie31-Aug-07 1:16
\laddie31-Aug-07 1:16 
QuestionInput String Pin
minniemooo31-Aug-07 0:51
minniemooo31-Aug-07 0:51 
AnswerRe: Input String Pin
Colin Angus Mackay31-Aug-07 0:59
Colin Angus Mackay31-Aug-07 0:59 
AnswerRe: Input String Pin
Luc Pattyn31-Aug-07 3:57
sitebuilderLuc Pattyn31-Aug-07 3:57 
QuestionHi Control rendering Pin
CodeVarma31-Aug-07 0:33
CodeVarma31-Aug-07 0:33 
QuestionDataGrid Pin
André Stroebel30-Aug-07 22:49
André Stroebel30-Aug-07 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.