1

While browsing some code online I've come across the following:

~Disposable()
{
   Dispose(false);
}

This doesn't produce any compiler errors, is the '~' doing anything in particular or why is it there?

SOfanatic
  • 5,400
  • 5
  • 33
  • 55

1 Answers1

14

That is called a finalizer in C#. What it does is override the Finalize method using a syntax similar to a destructor.

vcsjones
  • 133,702
  • 30
  • 291
  • 279