T
Trevor Balcom
I would like to do things when my object goes out of scope, like
disconnect TCP/IP streams, serialize collections to files and so on... Would
I implement my cleanup code in Dispose() ?
Is this correct?
class A : IDisposable
{
A()
{
}
~A()
{
Dispose();
}
public void Dispose()
{
//clean up stuff here
}
}
disconnect TCP/IP streams, serialize collections to files and so on... Would
I implement my cleanup code in Dispose() ?
Is this correct?
class A : IDisposable
{
A()
{
}
~A()
{
Dispose();
}
public void Dispose()
{
//clean up stuff here
}
}