I am looking for an example in which shows dispose pattern of .net with managed and un-managed resourced are allocated. In every text boo开发者_运维技巧k only code snippets are shown.
As of .net 2.0 it's advised to use SafeHandle
s to manage resources, as detailed on this MSDN page.
MSDN has an example on its IDisposable.Dispose
Method page, although as per comments, this is outdated.
I think that all you have to know is very well described in the following article "Digging into IDisposable" on MSDN : http://msdn.microsoft.com/en-us/magazine/cc163392.aspx
精彩评论