Dispose Pattern -- why void Dispose() is nonvirtual?
am 24.01.2008 20:19:45 von GzHi,
Does anyone know the reason?
Thanks,
gz
Hi,
Does anyone know the reason?
Thanks,
gz
gz
> Does anyone know the reason?
Once you've got a virtual Dispose(bool) method, there's no need for the
normal Dispose to remain virtual, and keeping it so could lead to
inappropriate implementations which didn't call base.Dispose() - or
which called Dispose(bool) themselves as well as base.Dispose().
--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
On Jan 24, 1:28=A0pm, Jon Skeet [C# MVP]
> gz
> > Does anyone know the reason?
>
> Once you've got a virtual Dispose(bool) method, there's no need for the
> normal Dispose to remain virtual, and keeping it so could lead to
> inappropriate implementations which didn't call base.Dispose() - or
> which called Dispose(bool) themselves as well as base.Dispose().
>
> --
> Jon Skeet -
w.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk
I see. Thanks.