Click here to Skip to main content
15,887,485 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionFinalize method Pin
rockyl12-Dec-06 3:04
rockyl12-Dec-06 3:04 
AnswerRe: Finalize method Pin
Rob Graham12-Dec-06 3:13
Rob Graham12-Dec-06 3:13 
GeneralRe: Finalize method Pin
rockyl12-Dec-06 3:44
rockyl12-Dec-06 3:44 
GeneralRe: Finalize method Pin
Rob Graham12-Dec-06 7:57
Rob Graham12-Dec-06 7:57 
GeneralRe: Finalize method Pin
rockyl12-Dec-06 17:12
rockyl12-Dec-06 17:12 
GeneralRe: Finalize method Pin
User 58385212-Dec-06 12:03
User 58385212-Dec-06 12:03 
AnswerRe: Finalize method Pin
Guffa13-Dec-06 2:59
Guffa13-Dec-06 2:59 
GeneralRe: Finalize method Pin
Scott Dorman13-Dec-06 3:42
professionalScott Dorman13-Dec-06 3:42 
You can also take a look at this article: http://www.codeproject.com/useritems/idisposable.asp[^]

The scenario you are describing is generally called "weak references" and isn't really supported in .NET. There are some blog posts about it, you can search on Google for them if you are interested.

Keep in mind that when you implement a finalizer, you are incurring extra costs to using your object so you should only implement a finalizer if you have a very good reason. Every object that has a finalizer is put on a finalization queue when it is allocated, even if the finalizer is not run. The finalizer will only be run when your object is garbage collected AND it has not already been disposed.




-----------------------------
In just two days, tomorrow will be yesterday.

AnswerRe: Finalize method Pin
Guffa13-Dec-06 3:09
Guffa13-Dec-06 3:09 
GeneralRe: Finalize method Pin
Scott Dorman13-Dec-06 3:45
professionalScott Dorman13-Dec-06 3:45 
GeneralRe: Finalize method Pin
Guffa13-Dec-06 4:01
Guffa13-Dec-06 4:01 
GeneralRe: Finalize method Pin
Scott Dorman13-Dec-06 4:26
professionalScott Dorman13-Dec-06 4:26 
GeneralRe: Finalize method Pin
Guffa13-Dec-06 4:36
Guffa13-Dec-06 4:36 
GeneralRe: Finalize method Pin
karam chandrabose13-Dec-06 5:29
karam chandrabose13-Dec-06 5:29 
AnswerRe: Finalize method Pin
Guffa13-Dec-06 5:56
Guffa13-Dec-06 5:56 
QuestionImage Problem Pin
Tauseef A12-Dec-06 2:16
Tauseef A12-Dec-06 2:16 
AnswerRe: Image Problem Pin
Paul Conrad26-Dec-06 17:08
professionalPaul Conrad26-Dec-06 17:08 
QuestionWeb service Authentication Pin
Nithin Krishna12-Dec-06 0:28
Nithin Krishna12-Dec-06 0:28 
QuestionWither windows service? Pin
PhrankBooth11-Dec-06 16:05
PhrankBooth11-Dec-06 16:05 
QuestionVSTO for Outlook 2007 Pin
Felix Jongleur11-Dec-06 12:17
Felix Jongleur11-Dec-06 12:17 
QuestionVisual Studio Tools for Office version 2003 Pin
ocabrera7011-Dec-06 3:00
ocabrera7011-Dec-06 3:00 
QuestionModifying machine.config Pin
seanwright11-Dec-06 2:56
seanwright11-Dec-06 2:56 
AnswerRe: Modifying machine.config Pin
Pete O'Hanlon11-Dec-06 10:22
mvePete O'Hanlon11-Dec-06 10:22 
AnswerRe: Modifying machine.config Pin
Vasudevan Deepak Kumar12-Dec-06 3:22
Vasudevan Deepak Kumar12-Dec-06 3:22 
Questioncannot find one or more components.please reinstall the application Pin
MissionSuccess10-Dec-06 18:59
MissionSuccess10-Dec-06 18:59 

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.