0

Possible Duplicate:
What does the tilde (~) mean in C#?

What is the meaing of ~ before a method?

I saw this like here:

    ~myDirect3dClass() 
    { 

    }
Community
  • 1
  • 1
Thu marlo
  • 543
  • 2
  • 6
  • 10
  • It is a destructor used to relase the resources occupy by the object in C#.Net. – Waqar Janjua Jul 20 '11 at 12:16
  • 1
    @waqar important point; it does ***not*** release resources occupied by the object (that is the job of GC); it allows the class to release any *unmanaged* resources that it may know about. – Marc Gravell Jul 20 '11 at 12:22
  • yup, you are right. Thanks Marc. MSDN Link http://msdn.microsoft.com/en-us/library/66x5fx1b%28v=vs.80%29.aspx – Waqar Janjua Jul 20 '11 at 12:30

3 Answers3

3

That's the destructor of a class, aka. the Finalizer.

Sven
  • 21,903
  • 4
  • 56
  • 63
2

That is a destructor.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
0

That is a Destructor method of a class. Destructors are used to destruct instances of classes.

Neil Knight
  • 47,437
  • 25
  • 129
  • 188