The garbage collector is part of C# and happens whether you want it to or not.

You can choose when it happens though by implementing a using or by ensuring your classes inherits the idisposable interface.

Advertisements