Saturday, 1 October 2016

How to destroy an object in C#

In addtion to setting your object as null , you should also remove it from other objects which refrences it as well
if you class uses resources that needs to be freed up use IDisposable


public class Car: IDisposable
{
// free resources
public void Dispose()
{
}
}

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...