Can anyone please tell me how I can free objects in C#? For example, I have an object:
Object obj1 = new Object(); //Some code using obj1 /* Here I would l
GC will collect all but unmanaged resources.
The unmanaged resources should implement IDisposable. If you are using an object that implements IDisposable, then you should either call the object's Dispose() method when it is no longer needed or wrap its instance in a using statement.
IDisposable
Dispose()
using