Click here to Skip to main content
15,919,479 members
Home / Discussions / C#
   

C#

 
GeneralRe: Finalizer implementation Pin
George_George20-Apr-08 17:38
George_George20-Apr-08 17:38 
GeneralRe: Finalizer implementation Pin
carbon_golem21-Apr-08 1:53
carbon_golem21-Apr-08 1:53 
GeneralRe: Finalizer implementation Pin
George_George21-Apr-08 2:07
George_George21-Apr-08 2:07 
GeneralRe: Finalizer implementation Pin
carbon_golem21-Apr-08 6:32
carbon_golem21-Apr-08 6:32 
GeneralRe: Finalizer implementation Pin
George_George21-Apr-08 21:49
George_George21-Apr-08 21:49 
GeneralRe: Finalizer implementation Pin
carbon_golem22-Apr-08 2:39
carbon_golem22-Apr-08 2:39 
GeneralRe: Finalizer implementation Pin
George_George22-Apr-08 3:04
George_George22-Apr-08 3:04 
GeneralRe: Finalizer implementation Pin
George_George20-Apr-08 19:02
George_George20-Apr-08 19:02 
Hi Scott,


Scott Dorman wrote:
1. The order of finalization is non-determistic, so there is no guarantee that if you access another object from within your finalizer that it will still be available.

2. If by "wrapped objects" you mean an object that your are internally maintaining, it is safe under certain circumstances.


The wrapped object I mean member variable of a class. From your above comments, I think your points are, it is not safe to access member variable of a class inside Finalizer method.

But from this link, it seems it is safe to access, since all the referred objects are retained live in Finalier. This why I am confused.

I think your points are conflicting with what I mentioned above and quoted below. Any comments?

http://msdn2.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2[^]

--------------------
"How Finalization Affects Collection"

Since the internal object pointers must remain valid, not only will the objects directly needing finalization linger in memory but everything the object refers to, directly and indirectly, will also remain in memory. If a huge tree of objects was anchored by a single object that required finalization, then the entire tree would linger, potentially for a long time as we just discussed."
--------------------


regards,
George
GeneralRe: Finalizer implementation Pin
Scott Dorman22-Apr-08 17:13
professionalScott Dorman22-Apr-08 17:13 
GeneralRe: Finalizer implementation Pin
George_George22-Apr-08 17:20
George_George22-Apr-08 17:20 
GeneralRe: Finalizer implementation Pin
Scott Dorman22-Apr-08 17:36
professionalScott Dorman22-Apr-08 17:36 
GeneralRe: Finalizer implementation Pin
George_George22-Apr-08 17:47
George_George22-Apr-08 17:47 
GeneralRe: Finalizer implementation Pin
Scott Dorman23-Apr-08 2:15
professionalScott Dorman23-Apr-08 2:15 
GeneralRe: Finalizer implementation Pin
George_George23-Apr-08 2:49
George_George23-Apr-08 2:49 
Generalroot in managed heap Pin
George_George19-Apr-08 21:01
George_George19-Apr-08 21:01 
GeneralRe: root in managed heap Pin
Gareth H19-Apr-08 23:15
Gareth H19-Apr-08 23:15 
GeneralRe: root in managed heap Pin
George_George19-Apr-08 23:21
George_George19-Apr-08 23:21 
GeneralRe: root in managed heap Pin
Jordanwb20-Apr-08 4:06
Jordanwb20-Apr-08 4:06 
GeneralRe: root in managed heap Pin
Luc Pattyn20-Apr-08 2:37
sitebuilderLuc Pattyn20-Apr-08 2:37 
GeneralRe: root in managed heap Pin
George_George20-Apr-08 3:16
George_George20-Apr-08 3:16 
GeneralRe: root in managed heap Pin
Luc Pattyn20-Apr-08 3:38
sitebuilderLuc Pattyn20-Apr-08 3:38 
GeneralRe: root in managed heap Pin
George_George20-Apr-08 4:42
George_George20-Apr-08 4:42 
GeneralRe: root in managed heap Pin
Luc Pattyn20-Apr-08 13:03
sitebuilderLuc Pattyn20-Apr-08 13:03 
GeneralRe: root in managed heap Pin
George_George20-Apr-08 19:20
George_George20-Apr-08 19:20 
GeneralRe: root in managed heap Pin
Luc Pattyn20-Apr-08 22:42
sitebuilderLuc Pattyn20-Apr-08 22:42 

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.