Please provide a test case that shows this behavior

On Wed, Jan 29, 2014 at 5:00 PM, Tobias Käs <tobias.k...@gmx.de> wrote:

> Hi, the generic WeakReference<T> for .NET 4.5 sometimes returns true from
> TryGetTarget even though the target has been collected (the out-value is
> correctly set to null). All my WeakReferences have been initialized with
> non-null values.
>
> Looking at the source at github I can imagine that there is a race between
> the handle.IsAllocated check and the handle.Target retrieval, but I'm no
> expert. Should I file a bug on that one? I'm not sure what the expected
> behavior is since MSDN documentation of that method isn't so great, but if
> the caller has to check the out-value against null anyways, then the return
> value becomes kinda pointless in my opinion.
>
> Regards,
> Tobias
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to