T
Tom
Hi there.
I wonder how a singleton could be (auto)disposed.
For instance :
class Foo : IDisposable
{
private static readonly _instance = new Foo();
private Foo()
{
// opens a file or does anything that needs cleanup
}
public void Dispose()
{
}
public static Foo Instance
{
get { return( _instance ); }
}
}
I wonder how a singleton could be (auto)disposed.
For instance :
class Foo : IDisposable
{
private static readonly _instance = new Foo();
private Foo()
{
// opens a file or does anything that needs cleanup
}
public void Dispose()
{
}
public static Foo Instance
{
get { return( _instance ); }
}
}