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,523
  • 5
  • 36
  • 57

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
  • 138,677
  • 31
  • 291
  • 286