No no. Nothing bothers you:
using(var myObject = new DisposableObject()) { myObject.Dispose(); }
What exactly happens in this case depends on the semantics of DisposableObject . This may throw an exception, or it may be completely happy that Dispose is called twice.
It should be noted that removing objects and garbage collection are completely different concepts. Just because the object is located does not mean that it will be collected by garbage, and just because the object was collected by garbage does not mean that it will be deleted.
An object can be garbage collected as soon as all references to the object are destroyed or inaccessible. This cannot happen when the code runs inside using -block, because the block itself has a reference to the object.
source share