tag:blogger.com,1999:blog-5707533511952913639.post4521230227792566230..comments2024-01-01T23:29:01.200-05:00Comments on Code Crafter: Revisiting IDisposableJordãohttp://www.blogger.com/profile/07178574753933019008noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-5707533511952913639.post-29950331647534644792020-10-27T17:57:25.532-04:002020-10-27T17:57:25.532-04:00No, because when Dispose is called. The destructor...No, because when Dispose is called. The destructor will not be called anymore (it is Supressed).<br />If Dispose is not called manually, then it hasn't been called yet, so it is fine to call it from destructor.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5707533511952913639.post-47914592199525999552019-03-22T12:54:53.051-04:002019-03-22T12:54:53.051-04:00I think that in any case, there need to add privat...I think that in any case, there need to add private boolean variable "disposed" to not perform a cleanup call again and avoid an exceptionAnonymoushttps://www.blogger.com/profile/04444133238023412595noreply@blogger.comtag:blogger.com,1999:blog-5707533511952913639.post-18943461635798761242014-08-05T00:53:23.061-04:002014-08-05T00:53:23.061-04:00Very good pattern to implement Dispose. Thanks.Very good pattern to implement Dispose. Thanks.Anonymoushttps://www.blogger.com/profile/17299727591945652227noreply@blogger.comtag:blogger.com,1999:blog-5707533511952913639.post-33725249030414869292013-08-03T10:09:51.697-04:002013-08-03T10:09:51.697-04:00Yes Grebe, that's a very good idea.Yes Grebe, that's a very good idea.Jordãohttps://www.blogger.com/profile/07178574753933019008noreply@blogger.comtag:blogger.com,1999:blog-5707533511952913639.post-52649782987101524472013-08-03T02:58:41.419-04:002013-08-03T02:58:41.419-04:00Many thanks for this. I found it useful to impleme...Many thanks for this. I found it useful to implement as an abstract class:- <br /><br />public abstract class myDisposable : IDisposable<br /> {<br /> public void Dispose()<br /> {<br /> disposeManaged();<br /> disposeNative();<br /> GC.SuppressFinalize(this);<br /> }<br /> //----------------------------------------------------------Grebehttps://www.blogger.com/profile/11189434262487392086noreply@blogger.comtag:blogger.com,1999:blog-5707533511952913639.post-86462800315446697952013-01-04T07:07:13.374-05:002013-01-04T07:07:13.374-05:00Thank you. Great post!Thank you. Great post!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5707533511952913639.post-4140408874816306772011-05-23T07:12:46.804-04:002011-05-23T07:12:46.804-04:00Great post! I really like the simplicity that resu...Great post! I really like the simplicity that results from this usage pattern. Thanks for sharing.Daniel Lidströmhttps://www.blogger.com/profile/16935372605426490881noreply@blogger.com