[Mono-dev] What will happen if Dispose() hangs?

Robert Jordan robertj at gmx.net
Tue Jan 27 19:08:37 UTC 2015


On 27.01.2015 18:56, Edward Ned Harvey (mono) wrote:
>> From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
>> bounces at lists.ximian.com] On Behalf Of Robert Jordan
>>
>> You may want to look up how a sane IDisposable pattern has to be
>> sensibly implemented in .NET. You'll find out that Dispose()
>> shouldn't be called from a finalizer.
>
> Uhmm...  You got that wrong.  Here is the recommended pattern:
> https://msdn.microsoft.com/en-us/library/b1yfkh5e(v=vs.110).aspx
>
> Basically, *always* call Dispose(false) from the finalizer, if present, but avoid having a finalizer unless you need one.

That's Dispose(bool). I was speaking about Dispose().




More information about the Mono-devel-list mailing list