Calling GC.SuppressFinalize() from within a finalizer
问题 I was working on a class in which I had to dispose of managed and unmanged resources which looked something like this (only the disposing part, obviously): class MyDisposingExample : IDisposable { public void Dispose() { Dispose(true); } private void Dispose(bool callFromDispose) { // free unmanaged resources here if (callFromDispose) { // free managed resources here GC.SuppressFinalize(this); } } ~MyDisposingExample() { Dispose(false); } } And then a thought occurred to me. Why bother with