No, it does not. The
using
statement uses
System.IDisposeable
:
https://msdn.microsoft.com/en-us/library/Aa664736%28v=VS.71%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/yh598w02.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.idisposable.aspx[
^].
This interface is used as the way to perform any clean-up action in controlled manner, in contrast to GC. It is often used to release any unmanaged resource, but can be used for anything. In particular, I/O objects use it to flush the buffer and close handles. There are many other users.
As to GC, all managed memory is reclaimed based on such criterion as
reachability and objects via references. This criterion is much more complicated that one could think. Please see:
http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)[
^].
See also the comment to the question by Wes Aday. The application cannot control when garbage collection takes place. You abandon the object by having no references to it. At the same time, if, for example, 3 objects reference each other in cycle and there are no more references, they will be reclaimed anyway. It happens some time later, which you cannot control. And when it happens, object's destructor is called. This is the reason why destructors are written quite rarely; this technique can be used only if other of calling destructors and timing is absolutely non-critical.
—SA