Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
GeneralRe: object destroy Pin
Guffa19-Apr-08 5:16
Guffa19-Apr-08 5:16 
GeneralRe: object destroy Pin
George_George19-Apr-08 20:46
George_George19-Apr-08 20:46 
GeneralRe: object destroy Pin
Luc Pattyn19-Apr-08 3:59
sitebuilderLuc Pattyn19-Apr-08 3:59 
GeneralRe: object destroy Pin
George_George19-Apr-08 4:00
George_George19-Apr-08 4:00 
GeneralRe: object destroy Pin
Luc Pattyn19-Apr-08 4:09
sitebuilderLuc Pattyn19-Apr-08 4:09 
GeneralRe: object destroy Pin
George_George19-Apr-08 4:19
George_George19-Apr-08 4:19 
GeneralRe: object destroy Pin
Dave Kreskowiak19-Apr-08 4:38
mveDave Kreskowiak19-Apr-08 4:38 
GeneralRe: object destroy Pin
Zoltan Balazs19-Apr-08 4:50
Zoltan Balazs19-Apr-08 4:50 
Dave Kreskowiak wrote:
It's well-known that object finalization in .NET is non-deteministic.

Yes, I know that.
I was refering to when you have a class and that class has a member. In that case the freeing order is well defined.
As Luc pointed out in the car example, first you free the wheel object and after that the car. Don't you agree with me?

link[^]
"How Finalization Affects Collection
When the garbage collector first encounters an object that is otherwise dead but still needs to be finalized it must abandon its attempt to reclaim the space for that object at that time. The object is instead added to a list of objects needing finalization and, furthermore, the collector must then ensure that all of the pointers within the object remain valid until finalization is complete.
....
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."

And yes this is for objects that need finalization.



GeneralRe: object destroy Pin
Dave Kreskowiak19-Apr-08 7:06
mveDave Kreskowiak19-Apr-08 7:06 
GeneralRe: object destroy Pin
George_George19-Apr-08 20:58
George_George19-Apr-08 20:58 
GeneralRe: object destroy Pin
George_George19-Apr-08 20:57
George_George19-Apr-08 20:57 
GeneralRe: object destroy Pin
George_George19-Apr-08 20:50
George_George19-Apr-08 20:50 
GeneralRe: object destroy Pin
Guffa19-Apr-08 4:09
Guffa19-Apr-08 4:09 
GeneralRe: object destroy Pin
George_George19-Apr-08 4:23
George_George19-Apr-08 4:23 
GeneralRe: object destroy Pin
Dave Kreskowiak19-Apr-08 4:28
mveDave Kreskowiak19-Apr-08 4:28 
GeneralRe: object destroy Pin
George_George19-Apr-08 4:52
George_George19-Apr-08 4:52 
GeneralRe: object destroy Pin
Guffa19-Apr-08 4:37
Guffa19-Apr-08 4:37 
GeneralRe: object destroy Pin
George_George19-Apr-08 4:51
George_George19-Apr-08 4:51 
GeneralRe: object destroy Pin
Guffa19-Apr-08 5:30
Guffa19-Apr-08 5:30 
GeneralRe: object destroy Pin
George_George19-Apr-08 20:48
George_George19-Apr-08 20:48 
GeneralRe: object destroy Pin
Dave Kreskowiak19-Apr-08 7:12
mveDave Kreskowiak19-Apr-08 7:12 
GeneralRe: object destroy Pin
George_George19-Apr-08 20:48
George_George19-Apr-08 20:48 
QuestionOn Media player Pin
varun.g19-Apr-08 1:12
varun.g19-Apr-08 1:12 
GeneralRe: On Media player Pin
Anthony Mushrow19-Apr-08 2:09
professionalAnthony Mushrow19-Apr-08 2:09 
QuestionHow to create MultiColumn ListBox Pin
Muhammad Gouda18-Apr-08 23:36
Muhammad Gouda18-Apr-08 23:36 

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.