D
David W
Hi
If I have a class that has lets say a big byte array or something, can I
just have a dispose method with nothing in it yet still use the using
statement so that the byte array will get freed immediatly. The other
alternative I guess is I could call GC.Collect, but I think the using
statement is much nicer.
public class BigClass : IDisposable
{
byte [] buffer = new byte[10000000];
void Dispose()
{
//No code
}
}
using( BigClass bigclass)
{
}
Thanks.
If I have a class that has lets say a big byte array or something, can I
just have a dispose method with nothing in it yet still use the using
statement so that the byte array will get freed immediatly. The other
alternative I guess is I could call GC.Collect, but I think the using
statement is much nicer.
public class BigClass : IDisposable
{
byte [] buffer = new byte[10000000];
void Dispose()
{
//No code
}
}
using( BigClass bigclass)
{
}
Thanks.