Hi I have code here where I don\'t understand why I hit the breakpoint (see comment).
Is this a Microsoft bug of something I don\'t know or I don\'t understand prope
The WeakReference _weakB
is available for garbage collection at the same time as the object a
is. You don't have a guarantee of order here, so it could very well be that _weakB
is finalized before object a
.
Accessing _weakB
in the finalizer of A is dangerous, since you don't know the state of _weakB
. I'm guessing that in your case it has been finalized, and that that is causing it to return null for .Target
.