J
Jay B. Harlow [MVP - Outlook]
Cor,
may be in 2 milliseconds or 2 hours depending on GC pressure.
Calling Dispose directly (or indirectly via the Using statement) will ensure
that the object is disposed of immediately! Plus it may reduce GC pressure
as Disposable classes occasionally have a Finalizer. Dispose will commonly
call SuppressFinalize to avoid having the object wait in the Finalization
queue...
Hence the importance of using the Using statement...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
Yes it will eventually be disposed of. At the discretion of the GC. WhichIt is completely inside the method, if the dispose is not there it goes
out of scoop and will be disposed because the method ends.
may be in 2 milliseconds or 2 hours depending on GC pressure.
Calling Dispose directly (or indirectly via the Using statement) will ensure
that the object is disposed of immediately! Plus it may reduce GC pressure
as Disposable classes occasionally have a Finalizer. Dispose will commonly
call SuppressFinalize to avoid having the object wait in the Finalization
queue...
Hence the importance of using the Using statement...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net