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
  • 523
  • 2
  • 5
  • 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
  • 20,673
  • 4
  • 54
  • 61
2

That is a destructor.

David Heffernan
  • 587,191
  • 41
  • 1,025
  • 1,442
0

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

Neil Knight
  • 45,890
  • 23
  • 126
  • 186