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

.NET (Core and Framework)

 
GeneralRe: Finalize method Pin
User 58385212-Dec-06 12:03
User 58385212-Dec-06 12:03 
Rob Graham wrote:
The finalize method is needed to free unmanaged resources that the object may own (memory,handles, etc.). If these are never feed, there would be a memory leak. Not all objects have unmanaged resources, so many do not need a finalize method.


I'm a bit confused by this stuff at the moment. I read this article[^] and it seemed to suggest that a finaliser is required as a back up in case the person using your class does not call Dispose() when they are finished with the object.

For example, if I have a class A that has a reference to another dot net class B and attaches to events on B in the constructor where do I unattach from the event? If I put it in a Dispose() method and the user of the class does not call Dispose() on it what happens? The article above seemed to suggest that I should implement a Finalizer to handle this case


System.IO.Path.IsPathRooted() does not behave as I would expect

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 
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 
QuestionRe: System.Security.Cryptography.RSAParameters parameters Pin
edchan10-Dec-06 18:50
edchan10-Dec-06 18:50 
QuestionSMTP Event Sink ForkForRecipients Pin
Andrewiski10-Dec-06 16:18
Andrewiski10-Dec-06 16:18 
Question[C#] Disable a 'beep'. Pin
Manaxter10-Dec-06 14:26
Manaxter10-Dec-06 14:26 
AnswerRe: [C#] Disable a 'beep'. Pin
Ravi Bhavnani10-Dec-06 14:55
professionalRavi Bhavnani10-Dec-06 14:55 
GeneralRe: [C#] Disable a 'beep'. Pin
Manaxter10-Dec-06 16:38
Manaxter10-Dec-06 16:38 

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.