U
Uwe Hafner
Hi,
1.
if an event is added a method in the same class like:
this.myevent += new MyEventHandler(this.DoMyEvent);
this would be a pointer to a method in my own class.
Does this prevent GC from collecting the object if it is the only reference
left? Or does the GC not count this reference of the object to a method in
itself?
I would expect the GC to still collect the object. Can someone confirm this?
2.
Is there a tool I can use for monitoring my objects if they are GCed
correctly (where I can explicitly track definite instances of a class) ?
Thanks
Uwe
1.
if an event is added a method in the same class like:
this.myevent += new MyEventHandler(this.DoMyEvent);
this would be a pointer to a method in my own class.
Does this prevent GC from collecting the object if it is the only reference
left? Or does the GC not count this reference of the object to a method in
itself?
I would expect the GC to still collect the object. Can someone confirm this?
2.
Is there a tool I can use for monitoring my objects if they are GCed
correctly (where I can explicitly track definite instances of a class) ?
Thanks
Uwe